var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};define("template",["jquery"],function(t){"use strict";return function(e,n){var o;return o=e||"",t.each(n,function(e,n){var i,r;i="undefined"==typeof n?"undefined":_typeof(n),r=new RegExp("{{\\s*"+e+"\\s*}}","g"),"object"===i&&null!==n?t.each(n,function(t,n){var i;i=new RegExp("{{\\s*"+e+"."+t+"\\s*}}","g"),o=o.replace(i,n)}):o=o.replace(r,n)}),o}});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};define("sfModal",["jquery","template","bootstrap"],function(t,e){"use strict";return function(n){var o,i;if("object"!==("undefined"==typeof n?"undefined":_typeof(n))){if("hide"===n)return void t(".sfmodal").modal("hide");if("toggle"===n)return void t(".sfmodal").modal("toggle");n={content:n,hideDone:!0}}o=t.extend({hideTitle:!1,hideFooter:!1,modalSize:"",title:"操作失败",content:"玩脱了",wrapper:null,$content:null,hideClose:!1,closeText:"取消",closeClass:"btn-default",backdrop:!0,closeFn:function(){},hideDone:!1,doneText:"确认",doneClass:"btn-primary",keyboard:"true",afterShow:function(){},doneFn:function(){t(".sfmodal").modal("hide")},show:function(){},shown:function(){},hide:function(){},hidden:function(){},loaded:function(){}},n),i='",t(".sfmodal").length>0&&(t(".sfmodal").remove(),t(".modal-backdrop").remove()),o.wrapper?(t(o.wrapper).append(e(i,o)),t(o.wrapper).append('')):t("body").append(e(i,o)),o.$content?t(".sfmodal .sfModal-content").append(o.$content):t(".sfmodal .sfModal-content").html(o.content),t(".sfmodal").modal({keyboard:o.keyboard,backdrop:o.backdrop}),t(".sfmodal").on("show.bs.modal",o.show).on("hide.bs.modal",function(e){o.hide(e),o.wrapper&&t(".modal-backdrop").remove()}).on("hidden.bs.modal",o.hidden).on("loaded.bs.modal",o.loaded).on("shown.bs.modal",o.shown).modal("show"),o.afterShow&&o.afterShow(),t(".sfmodal .done-btn").click(function(e){o.doneFn(e),o.wrapper&&t(".modal-backdrop").remove()}),t(".sfmodal .close-btn").click(function(e){o.closeFn(e),o.wrapper&&t(".modal-backdrop").remove()})}}),define("mobile",["jquery"],function(t){return window.innerWidth>767?{login:null,signup:null}:(t(".hate, .like").data("toggle","false"),{login:function(){location.href="/user/login"},signup:function(){location.href="/user/register"}})}),define("isMobile",[],function(){var t;return t=function(t){var e,n;return e={Android:function(){return!!navigator.userAgent.match(/Android/i)},BlackBerry:function(){return!!navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return!!navigator.userAgent.match(/iPhone|iPad|iPod/i)},Windows:function(){return!!navigator.userAgent.match(/IEMobile/i)},any:function(){return e.Android()||e.BlackBerry()||e.iOS()||e.Windows()}},n=e[t]()||!1}}),!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define("socket.io",[],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.io=t()}}(function(){var t;return function t(e,n,o){function i(a,s){if(!n[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(r)return r(a,!0);throw new Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},o.prototype.cleanup=function(){for(var t;t=this.subs.shift();)t.destroy();this.packetBuffer=[],this.encoding=!1,this.decoder.destroy()},o.prototype.close=o.prototype.disconnect=function(){this.skipReconnect=!0,this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},o.prototype.onclose=function(t){u("close"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},o.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)u("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();u("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var n=setTimeout(function(){t.skipReconnect||(u("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(u("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(u("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(n)}})}},o.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},{"./on":4,"./socket":5,"./url":6,backo2:7,"component-bind":8,"component-emitter":9,debug:10,"engine.io-client":11,indexof:40,"object-component":41,"socket.io-parser":44}],4:[function(t,e,n){function o(t,e,n){return t.on(e,n),{destroy:function(){t.removeListener(e,n)}}}e.exports=o},{}],5:[function(t,e,n){function o(t,e){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.io.autoConnect&&this.open(),this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0}var i=t("socket.io-parser"),r=t("component-emitter"),a=t("to-array"),s=t("./on"),l=t("component-bind"),c=t("debug")("socket.io-client:socket"),u=t("has-binary");e.exports=n=o;var p={connect:1,connect_error:1,connect_timeout:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1},d=r.prototype.emit;r(o.prototype),o.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[s(t,"open",l(this,"onopen")),s(t,"packet",l(this,"onpacket")),s(t,"close",l(this,"onclose"))]}},o.prototype.open=o.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"==this.io.readyState&&this.onopen(),this)},o.prototype.send=function(){var t=a(arguments);return t.unshift("message"),this.emit.apply(this,t),this},o.prototype.emit=function(t){if(p.hasOwnProperty(t))return d.apply(this,arguments),this;var e=a(arguments),n=i.EVENT;u(e)&&(n=i.BINARY_EVENT);var o={type:n,data:e};return"function"==typeof e[e.length-1]&&(c("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),o.id=this.ids++),this.connected?this.packet(o):this.sendBuffer.push(o),this},o.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},o.prototype.onopen=function(){c("transport is open - connecting"),"/"!=this.nsp&&this.packet({type:i.CONNECT})},o.prototype.onclose=function(t){c("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},o.prototype.onpacket=function(t){if(t.nsp==this.nsp)switch(t.type){case i.CONNECT:this.onconnect();break;case i.EVENT:this.onevent(t);break;case i.BINARY_EVENT:this.onevent(t);break;case i.ACK:this.onack(t);break;case i.BINARY_ACK:this.onack(t);break;case i.DISCONNECT:this.ondisconnect();break;case i.ERROR:this.emit("error",t.data)}},o.prototype.onevent=function(t){var e=t.data||[];c("emitting event %j",e),null!=t.id&&(c("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?d.apply(this,e):this.receiveBuffer.push(e)},o.prototype.ack=function(t){var e=this,n=!1;return function(){if(!n){n=!0;var o=a(arguments);c("sending ack %j",o);var r=u(o)?i.BINARY_ACK:i.ACK;e.packet({type:r,id:t,data:o})}}},o.prototype.onack=function(t){c("calling ack %s with %j",t.id,t.data);var e=this.acks[t.id];e.apply(this,t.data),delete this.acks[t.id]},o.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},o.prototype.emitBuffered=function(){var t;for(t=0;t0&&t.jitter<=1?t.jitter:0,this.attempts=0}e.exports=o,o.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},o.prototype.reset=function(){this.attempts=0},o.prototype.setMin=function(t){this.ms=t},o.prototype.setMax=function(t){this.max=t},o.prototype.setJitter=function(t){this.jitter=t}},{}],8:[function(t,e,n){var o=[].slice;e.exports=function(t,e){if("string"==typeof e&&(e=t[e]),"function"!=typeof e)throw new Error("bind() requires a function");var n=o.call(arguments,2);return function(){return e.apply(t,n.concat(o.call(arguments)))}}},{}],9:[function(t,e,n){function o(t){if(t)return i(t)}function i(t){for(var e in o.prototype)t[e]=o.prototype[e];return t}e.exports=o,o.prototype.on=o.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},o.prototype.once=function(t,e){function n(){o.off(t,n),e.apply(this,arguments)}var o=this;return this._callbacks=this._callbacks||{},n.fn=e,this.on(t,n),this},o.prototype.off=o.prototype.removeListener=o.prototype.removeAllListeners=o.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[t];if(!n)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var o,i=0;i=o?(t/o).toFixed(1)+"h":t>=n?(t/n).toFixed(1)+"m":t>=e?(t/e|0)+"s":t+"ms"},o.enabled=function(t){for(var e=0,n=o.skips.length;e';r=document.createElement(t)}catch(t){r=document.createElement("iframe"),r.name=i.iframeId,r.src="javascript:0"}r.id=i.iframeId,i.form.appendChild(r),i.iframe=r}var i=this;if(!this.form){var r,a=document.createElement("form"),s=document.createElement("textarea"),u=this.iframeId="eio_iframe_"+this.index;a.className="socketio",a.style.position="absolute",a.style.top="-1000px",a.style.left="-1000px",a.target=u,a.method="POST",a.setAttribute("accept-charset","utf-8"),s.name="d",a.appendChild(s),document.body.appendChild(a),this.form=a,this.area=s}this.form.action=this.uri(),o(),t=t.replace(c,"\\\n"),this.area.value=t.replace(l,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"==i.iframe.readyState&&n()}:this.iframe.onload=n}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling":18,"component-inherit":21}],17:[function(t,e,n){(function(n){function o(){}function i(t){ if(l.call(this,t),n.location){var e="https:"==location.protocol,o=location.port;o||(o=e?443:80),this.xd=t.hostname!=n.location.hostname||o!=t.port,this.xs=t.secure!=e}}function r(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=!1!==t.async,this.data=void 0!=t.data?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.create()}function a(){for(var t in r.requests)r.requests.hasOwnProperty(t)&&r.requests[t].abort()}var s=t("xmlhttprequest"),l=t("./polling"),c=t("component-emitter"),u=t("component-inherit"),p=t("debug")("engine.io-client:polling-xhr");e.exports=i,e.exports.Request=r,u(i,l),i.prototype.supportsBinary=!0,i.prototype.request=function(t){return t=t||{},t.uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,new r(t)},i.prototype.doWrite=function(t,e){var n="string"!=typeof t&&void 0!==t,o=this.request({method:"POST",data:t,isBinary:n}),i=this;o.on("success",e),o.on("error",function(t){i.onError("xhr post error",t)}),this.sendXhr=o},i.prototype.doPoll=function(){p("xhr poll");var t=this.request(),e=this;t.on("data",function(t){e.onData(t)}),t.on("error",function(t){e.onError("xhr poll error",t)}),this.pollXhr=t},c(r.prototype),r.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized;var e=this.xhr=new s(t),o=this;try{if(p("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async),this.supportsBinary&&(e.responseType="arraybuffer"),"POST"==this.method)try{this.isBinary?e.setRequestHeader("Content-type","application/octet-stream"):e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}"withCredentials"in e&&(e.withCredentials=!0),this.hasXDR()?(e.onload=function(){o.onLoad()},e.onerror=function(){o.onError(e.responseText)}):e.onreadystatechange=function(){4==e.readyState&&(200==e.status||1223==e.status?o.onLoad():setTimeout(function(){o.onError(e.status)},0))},p("xhr data %s",this.data),e.send(this.data)}catch(t){return void setTimeout(function(){o.onError(t)},0)}n.document&&(this.index=r.requestsCount++,r.requests[this.index]=this)},r.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},r.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},r.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},r.prototype.cleanup=function(t){if("undefined"!=typeof this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=o:this.xhr.onreadystatechange=o,t)try{this.xhr.abort()}catch(t){}n.document&&delete r.requests[this.index],this.xhr=null}},r.prototype.onLoad=function(){var t;try{var e;try{e=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch(t){}t="application/octet-stream"===e?this.xhr.response:this.supportsBinary?"ok":this.xhr.responseText}catch(t){this.onError(t)}null!=t&&this.onData(t)},r.prototype.hasXDR=function(){return"undefined"!=typeof n.XDomainRequest&&!this.xs&&this.enablesXDR},r.prototype.abort=function(){this.cleanup()},n.document&&(r.requestsCount=0,r.requests={},n.attachEvent?n.attachEvent("onunload",a):n.addEventListener&&n.addEventListener("beforeunload",a,!1))}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./polling":18,"component-emitter":9,"component-inherit":21,debug:22,xmlhttprequest:20}],18:[function(t,e,n){function o(t){var e=t&&t.forceBase64;c&&!e||(this.supportsBinary=!1),i.call(this,t)}var i=t("../transport"),r=t("parseqs"),a=t("engine.io-parser"),s=t("component-inherit"),l=t("debug")("engine.io-client:polling");e.exports=o;var c=function(){var e=t("xmlhttprequest"),n=new e({xdomain:!1});return null!=n.responseType}();s(o,i),o.prototype.name="polling",o.prototype.doOpen=function(){this.poll()},o.prototype.pause=function(t){function e(){l("paused"),n.readyState="paused",t()}var n=this;if(this.readyState="pausing",this.polling||!this.writable){var o=0;this.polling&&(l("we are currently polling - waiting to pause"),o++,this.once("pollComplete",function(){l("pre-pause polling complete"),--o||e()})),this.writable||(l("we are currently writing - waiting to pause"),o++,this.once("drain",function(){l("pre-pause writing complete"),--o||e()}))}else e()},o.prototype.poll=function(){l("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},o.prototype.onData=function(t){var e=this;l("polling got data %s",t);var n=function(t,n,o){return"opening"==e.readyState&&e.onOpen(),"close"==t.type?(e.onClose(),!1):void e.onPacket(t)};a.decodePayload(t,this.socket.binaryType,n),"closed"!=this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"==this.readyState?this.poll():l('ignoring poll - transport state "%s"',this.readyState))},o.prototype.doClose=function(){function t(){l("writing close packet"),e.write([{type:"close"}])}var e=this;"open"==this.readyState?(l("transport open - closing"),t()):(l("transport not open - deferring close"),this.once("open",t))},o.prototype.write=function(t){var e=this;this.writable=!1;var n=function(){e.writable=!0,e.emit("drain")},e=this;a.encodePayload(t,this.supportsBinary,function(t){e.doWrite(t,n)})},o.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(t[this.timestampParam]=+new Date+"-"+i.timestamps++),this.supportsBinary||t.sid||(t.b64=1),t=r.encode(t),this.port&&("https"==e&&443!=this.port||"http"==e&&80!=this.port)&&(n=":"+this.port),t.length&&(t="?"+t),e+"://"+this.hostname+n+this.path+t}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,xmlhttprequest:20}],19:[function(t,e,n){function o(t){var e=t&&t.forceBase64;e&&(this.supportsBinary=!1),i.call(this,t)}var i=t("../transport"),r=t("engine.io-parser"),a=t("parseqs"),s=t("component-inherit"),l=t("debug")("engine.io-client:websocket"),c=t("ws");e.exports=o,s(o,i),o.prototype.name="websocket",o.prototype.supportsBinary=!0,o.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=void 0,n={agent:this.agent};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.ws=new c(t,e,n),void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.binaryType="arraybuffer",this.addEventListeners()}},o.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},"undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(o.prototype.onData=function(t){var e=this;setTimeout(function(){i.prototype.onData.call(e,t)},0)}),o.prototype.write=function(t){function e(){n.writable=!0,n.emit("drain")}var n=this;this.writable=!1;for(var o=0,i=t.length;o=31}function i(){var t=arguments,e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+n.humanize(this.diff),!e)return t;var o="color: "+this.color;t=[t[0],o,"color: inherit"].concat(Array.prototype.slice.call(t,1));var i=0,r=0;return t[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(i++,"%c"===t&&(r=i))}),t.splice(r,0,o),t}function r(){return"object"==typeof console&&"function"==typeof console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?localStorage.removeItem("debug"):localStorage.debug=t}catch(t){}}function s(){var t;try{t=localStorage.debug}catch(t){}return t}n=e.exports=t("./debug"),n.log=r,n.formatArgs=i,n.save=a,n.load=s,n.useColors=o,n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(t){return JSON.stringify(t)},n.enable(s())},{"./debug":23}],23:[function(t,e,n){function o(){return n.colors[u++%n.colors.length]}function i(t){function e(){}function i(){var t=i,e=+new Date,r=e-(c||e);t.diff=r,t.prev=c,t.curr=e,c=e,null==t.useColors&&(t.useColors=n.useColors()),null==t.color&&t.useColors&&(t.color=o());var a=Array.prototype.slice.call(arguments);a[0]=n.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var s=0;a[0]=a[0].replace(/%([a-z%])/g,function(e,o){if("%%"===e)return e;s++;var i=n.formatters[o];if("function"==typeof i){var r=a[s];e=i.call(t,r),a.splice(s,1),s--}return e}),"function"==typeof n.formatArgs&&(a=n.formatArgs.apply(t,a));var l=i.log||n.log||console.log.bind(console);l.apply(t,a)}e.enabled=!1,i.enabled=!0;var r=n.enabled(t)?i:e;return r.namespace=t,r}function r(t){n.save(t);for(var e=(t||"").split(/[\s,]+/),o=e.length,i=0;i=u?Math.round(t/u)+"d":t>=c?Math.round(t/c)+"h":t>=l?Math.round(t/l)+"m":t>=s?Math.round(t/s)+"s":t+"ms"}function r(t){return a(t,u,"day")||a(t,c,"hour")||a(t,l,"minute")||a(t,s,"second")||t+" ms"}function a(t,e,n){if(!(t1?{type:y[i],data:t.substring(1)}:{type:y[i]}:b}var r=new Uint8Array(t),i=r[0],a=u(t,1);return _&&"blob"===e&&(a=new _([a])),{type:y[i],data:a}},n.decodeBase64Packet=function(t,n){var o=y[t.charAt(0)];if(!e.ArrayBuffer)return{type:o,data:{base64:!0,data:t.substr(1)}};var i=p.decode(t.substr(1));return"blob"===n&&_&&(i=new _([i])),{type:o,data:i}},n.encodePayload=function(t,e,o){function i(t){return t.length+":"+t}function r(t,o){n.encodePacket(t,!!a&&e,!0,function(t){o(null,i(t))})}"function"==typeof e&&(o=e,e=null);var a=c(t);return e&&a?_&&!g?n.encodePayloadAsBlob(t,o):n.encodePayloadAsArrayBuffer(t,o):t.length?void s(t,r,function(t,e){return o(e.join(""))}):o("0:")},n.decodePayload=function(t,e,o){if("string"!=typeof t)return n.decodePayloadAsBinary(t,e,o);"function"==typeof e&&(o=e,e=null);var i;if(""==t)return o(b,0,1);for(var r,a,s="",l=0,c=t.length;l0;){for(var s=new Uint8Array(i),l=0===s[0],c="",p=1;255!=s[p];p++){if(c.length>310){a=!0;break}c+=s[p]}if(a)return o(b,0,1);i=u(i,2+c.length),c=parseInt(c);var d=u(i,0,c);if(l)try{d=String.fromCharCode.apply(null,new Uint8Array(d))}catch(t){var h=new Uint8Array(d);d="";for(var p=0;po&&(n=o),e>=o||e>=n||0===o)return new ArrayBuffer(0);for(var i=new Uint8Array(t),r=new Uint8Array(n-e),a=e,s=0;a>2],r+=t[(3&o[n])<<4|o[n+1]>>4],r+=t[(15&o[n+1])<<2|o[n+2]>>6],r+=t[63&o[n+2]];return i%3===2?r=r.substring(0,r.length-1)+"=":i%3===1&&(r=r.substring(0,r.length-2)+"=="),r},n.decode=function(e){var n,o,i,r,a,s=.75*e.length,l=e.length,c=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var u=new ArrayBuffer(s),p=new Uint8Array(u);for(n=0;n>4,p[c++]=(15&i)<<4|r>>2,p[c++]=(3&r)<<6|63&a;return u}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],30:[function(t,e,n){(function(t){function n(t){for(var e=0;e=55296&&e<=56319&&i65535&&(e-=65536,i+=_(e>>>10&1023|55296),e=56320|1023&e),i+=_(e);return i}function s(t){if(t>=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function l(t,e){return _(t>>e&63|128)}function c(t){if(0==(4294967168&t))return _(t);var e="";return 0==(4294965248&t)?e=_(t>>6&31|192):0==(4294901760&t)?(s(t),e=_(t>>12&15|224),e+=l(t,6)):0==(4292870144&t)&&(e=_(t>>18&7|240),e+=l(t,12),e+=l(t,6)),e+=_(63&t|128)}function u(t){for(var e,n=r(t),o=n.length,i=-1,a="";++i=y)throw Error("Invalid byte index");var t=255&v[b];if(b++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function d(){var t,e,n,o,i;if(b>y)throw Error("Invalid byte index");if(b==y)return!1;if(t=255&v[b],b++,0==(128&t))return t;if(192==(224&t)){var e=p();if(i=(31&t)<<6|e,i>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&t)){if(e=p(),n=p(),i=(15&t)<<12|e<<6|n,i>=2048)return s(i),i;throw Error("Invalid continuation byte")}if(240==(248&t)&&(e=p(),n=p(),o=p(),i=(15&t)<<18|e<<12|n<<6|o,i>=65536&&i<=1114111))return i;throw Error("Invalid UTF-8 detected")}function h(t){v=r(t),y=v.length,b=0;for(var e,n=[];(e=d())!==!1;)n.push(e);return a(n)}var f="object"==typeof o&&o,m="object"==typeof n&&n&&n.exports==f&&n,g="object"==typeof e&&e;g.global!==g&&g.window!==g||(i=g);var v,y,b,_=String.fromCharCode,w={version:"2.0.0",encode:u,decode:h};if("function"==typeof t&&"object"==typeof t.amd&&t.amd)t(function(){return w});else if(f&&!f.nodeType)if(m)m.exports=w;else{var k={},x=k.hasOwnProperty;for(var D in w)x.call(w,D)&&(f[D]=w[D])}else i.utf8=w}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],32:[function(t,e,n){(function(t){var n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,i=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,a=/^\s+/,s=/\s+$/;e.exports=function(e){return"string"==typeof e&&e?(e=e.replace(a,"").replace(s,""),t.JSON&&JSON.parse?JSON.parse(e):n.test(e.replace(o,"@").replace(i,"]").replace(r,""))?new Function("return "+e)():void 0):null}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],33:[function(t,e,n){n.encode=function(t){var e="";for(var n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e},n.decode=function(t){for(var e={},n=t.split("&"),o=0,i=n.length;o1)))/4)-b((t-1901+e)/100)+b((t-1601+e)/400)};(i={}.hasOwnProperty)||(i=function(t){var e,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=s?i=function(t){var e=this.__proto__,n=t in(this.__proto__=null,this);return this.__proto__=e,n}:(e=n.constructor,i=function(t){var n=(this.constructor||e).prototype;return t in this&&!(t in n&&this[t]===n[t])}),n=null,i.call(this,t)});var k={boolean:1,number:1,string:1,undefined:1},x=function(t,e){var n=typeof t[e];return"object"==n?!!t[e]:!k[n]};if(r=function(t,e){var n,o,a,l=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,o=new n;for(a in o)i.call(o,a)&&l++;return n=o=null,l?r=2==l?function(t,e){var n,o={},r=s.call(t)==d; for(n in t)r&&"prototype"==n||i.call(o,n)||!(o[n]=1)||!i.call(t,n)||e(n)}:function(t,e){var n,o,r=s.call(t)==d;for(n in t)r&&"prototype"==n||!i.call(t,n)||(o="constructor"===n)||e(n);(o||i.call(t,n="constructor"))&&e(n)}:(o=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],r=function(t,e){var n,r,a=s.call(t)==d,l=!a&&"function"!=typeof t.constructor&&x(t,"hasOwnProperty")?t.hasOwnProperty:i;for(n in t)a&&"prototype"==n||!l.call(t,n)||e(n);for(r=o.length;n=o[--r];l.call(t,n)&&e(n));}),r(t,e)},!n("json-stringify")){var D={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},C="000000",S=function(t,e){return(C+(e||0)).slice(-t)},$="\\u00",E=function(t){var e,n='"',o=0,i=t.length,r=i>10&&y;for(r&&(e=t.split(""));o-1/0&&p<1/0){if(w){for(k=b(p/864e5),y=b(k/365.2425)+1970-1;w(y+1,0)<=k;y++);for(_=b((k-w(y,0))/30.42);w(y,_+1)<=k;_++);k=1+k-w(y,_),x=(p%864e5+864e5)%864e5,D=b(x/36e5)%24,C=b(x/6e4)%60,$=b(x/1e3)%60,T=x%1e3}else y=p.getUTCFullYear(),_=p.getUTCMonth(),k=p.getUTCDate(),D=p.getUTCHours(),C=p.getUTCMinutes(),$=p.getUTCSeconds(),T=p.getUTCMilliseconds();p=(y<=0||y>=1e4?(y<0?"-":"+")+S(6,y<0?-y:y):S(4,y))+"-"+S(2,_+1)+"-"+S(2,k)+"T"+S(2,D)+":"+S(2,C)+":"+S(2,$)+"."+S(3,T)+"Z"}else p=null;if(n&&(p=n.call(e,t,p)),null===p)return"null";if(d=s.call(p),d==v)return""+p;if(d==f)return p>-1/0&&p<1/0?""+p:"null";if(d==m)return E(""+p);if("object"==typeof p){for(L=u.length;L--;)if(u[L]===p)throw TypeError();if(u.push(p),P=[],F=c,c+=l,d==g){for(I=0,L=p.length;I0)for(o="",n>10&&(n=10);o.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||L();t+=B("0x"+r.slice(e,T));break;default:L()}else{if(34==i)break;for(i=r.charCodeAt(T),e=T;i>=32&&92!=i&&34!=i;)i=r.charCodeAt(++T);t+=r.slice(e,T)}if(34==r.charCodeAt(T))return T++,t;L();default:if(e=T,45==i&&(o=!0,i=r.charCodeAt(++T)),i>=48&&i<=57){for(48==i&&(i=r.charCodeAt(T+1),i>=48&&i<=57)&&L(),o=!1;T=48&&i<=57);T++);if(46==r.charCodeAt(T)){for(n=++T;n=48&&i<=57);n++);n==T&&L(),T=n}if(i=r.charCodeAt(T),101==i||69==i){for(i=r.charCodeAt(++T),43!=i&&45!=i||T++,n=T;n=48&&i<=57);n++);n==T&&L(),T=n}return+r.slice(e,T)}if(o&&L(),"true"==r.slice(T,T+4))return T+=4,!0;if("false"==r.slice(T,T+5))return T+=5,!1;if("null"==r.slice(T,T+4))return T+=4,null;L()}return"$"},j=function(t){var e,n;if("$"==t&&L(),"string"==typeof t){if("@"==(y?t.charAt(0):t[0]))return t.slice(1);if("["==t){for(e=[];t=F(),"]"!=t;n||(n=!0))n&&(","==t?(t=F(),"]"==t&&L()):L()),","==t&&L(),e.push(j(t));return e}if("{"==t){for(e={};t=F(),"}"!=t;n||(n=!0))n&&(","==t?(t=F(),"}"==t&&L()):L()),","!=t&&"string"==typeof t&&"@"==(y?t.charAt(0):t[0])&&":"==F()||L(),e[t.slice(1)]=j(F());return e}L()}return t},O=function(t,e,n){var o=M(t,e,n);o===a?delete t[e]:t[e]=o},M=function(t,e,n){var o,i=t[e];if("object"==typeof i&&i)if(s.call(i)==g)for(o=i.length;o--;)O(i,o,n);else r(i,function(t){O(i,t,n)});return n.call(t,e,i)};u.parse=function(t,e){var n,o;return T=0,P=""+t,n=j(F()),"$"!=F()&&L(),T=P=null,e&&s.call(e)==d?M((o={},o[""]=n,o),"",e):n}}}l&&t(function(){return u})}(this)},{}],48:[function(t,e,n){function o(t,e){var n=[];e=e||0;for(var o=e||0;oo;o++)e(t[o],o,t);else{var r=h.keys(t);for(o=0,i=r.length;i>o;o++)e(t[r[o]],r[o],t)}return t},h.map=h.collect=function(t,e,n){if(null==t)return[];e=h.iteratee(e,n);for(var o,i=t.length!==+t.length&&h.keys(t),r=(i||t).length,a=Array(r),s=0;r>s;s++)o=i?i[s]:s,a[s]=e(t[o],o,t);return a};var m="Reduce of empty array with no initial value";h.reduce=h.foldl=h.inject=function(t,e,n,o){null==t&&(t=[]),e=f(e,o,4);var i,r=t.length!==+t.length&&h.keys(t),a=(r||t).length,s=0;if(arguments.length<3){if(!a)throw new TypeError(m);n=t[r?r[s++]:s++]}for(;a>s;s++)i=r?r[s]:s,n=e(n,t[i],i,t);return n},h.reduceRight=h.foldr=function(t,e,n,o){null==t&&(t=[]),e=f(e,o,4);var i,r=t.length!==+t.length&&h.keys(t),a=(r||t).length;if(arguments.length<3){if(!a)throw new TypeError(m);n=t[r?r[--a]:--a]}for(;a--;)i=r?r[a]:a,n=e(n,t[i],i,t);return n},h.find=h.detect=function(t,e,n){var o;return e=h.iteratee(e,n),h.some(t,function(t,n,i){return e(t,n,i)?(o=t,!0):void 0}),o},h.filter=h.select=function(t,e,n){var o=[];return null==t?o:(e=h.iteratee(e,n),h.each(t,function(t,n,i){e(t,n,i)&&o.push(t)}),o)},h.reject=function(t,e,n){return h.filter(t,h.negate(h.iteratee(e)),n)},h.every=h.all=function(t,e,n){if(null==t)return!0;e=h.iteratee(e,n);var o,i,r=t.length!==+t.length&&h.keys(t),a=(r||t).length;for(o=0;a>o;o++)if(i=r?r[o]:o,!e(t[i],i,t))return!1;return!0},h.some=h.any=function(t,e,n){if(null==t)return!1;e=h.iteratee(e,n);var o,i,r=t.length!==+t.length&&h.keys(t),a=(r||t).length;for(o=0;a>o;o++)if(i=r?r[o]:o,e(t[i],i,t))return!0;return!1},h.contains=h.include=function(t,e){return null!=t&&(t.length!==+t.length&&(t=h.values(t)),h.indexOf(t,e)>=0)},h.invoke=function(t,e){var n=a.call(arguments,2),o=h.isFunction(e);return h.map(t,function(t){return(o?e:t[e]).apply(t,n)})},h.pluck=function(t,e){return h.map(t,h.property(e))},h.where=function(t,e){return h.filter(t,h.matches(e))},h.findWhere=function(t,e){return h.find(t,h.matches(e))},h.max=function(t,e,n){var o,i,r=-1/0,a=-1/0;if(null==e&&null!=t){t=t.length===+t.length?t:h.values(t);for(var s=0,l=t.length;l>s;s++)o=t[s],o>r&&(r=o)}else e=h.iteratee(e,n),h.each(t,function(t,n,o){i=e(t,n,o),(i>a||i===-1/0&&r===-1/0)&&(r=t,a=i)});return r},h.min=function(t,e,n){var o,i,r=1/0,a=1/0;if(null==e&&null!=t){t=t.length===+t.length?t:h.values(t);for(var s=0,l=t.length;l>s;s++)o=t[s],r>o&&(r=o)}else e=h.iteratee(e,n),h.each(t,function(t,n,o){i=e(t,n,o),(a>i||1/0===i&&1/0===r)&&(r=t,a=i)});return r},h.shuffle=function(t){for(var e,n=t&&t.length===+t.length?t:h.values(t),o=n.length,i=Array(o),r=0;o>r;r++)e=h.random(0,r),e!==r&&(i[r]=i[e]),i[e]=n[r];return i},h.sample=function(t,e,n){return null==e||n?(t.length!==+t.length&&(t=h.values(t)),t[h.random(t.length-1)]):h.shuffle(t).slice(0,Math.max(0,e))},h.sortBy=function(t,e,n){return e=h.iteratee(e,n),h.pluck(h.map(t,function(t,n,o){return{value:t,index:n,criteria:e(t,n,o)}}).sort(function(t,e){var n=t.criteria,o=e.criteria;if(n!==o){if(n>o||void 0===n)return 1;if(o>n||void 0===o)return-1}return t.index-e.index}),"value")};var g=function(t){return function(e,n,o){var i={};return n=h.iteratee(n,o),h.each(e,function(o,r){var a=n(o,r,e);t(i,o,a)}),i}};h.groupBy=g(function(t,e,n){h.has(t,n)?t[n].push(e):t[n]=[e]}),h.indexBy=g(function(t,e,n){t[n]=e}),h.countBy=g(function(t,e,n){h.has(t,n)?t[n]++:t[n]=1}),h.sortedIndex=function(t,e,n,o){n=h.iteratee(n,o,1);for(var i=n(e),r=0,a=t.length;a>r;){var s=r+a>>>1;n(t[s])e?[]:a.call(t,0,e)},h.initial=function(t,e,n){return a.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},h.last=function(t,e,n){return null==t?void 0:null==e||n?t[t.length-1]:a.call(t,Math.max(t.length-e,0))},h.rest=h.tail=h.drop=function(t,e,n){return a.call(t,null==e||n?1:e)},h.compact=function(t){return h.filter(t,h.identity)};var v=function(t,e,n,o){if(e&&h.every(t,h.isArray))return s.apply(o,t);for(var i=0,a=t.length;a>i;i++){var l=t[i];h.isArray(l)||h.isArguments(l)?e?r.apply(o,l):v(l,e,n,o):n||o.push(l)}return o};h.flatten=function(t,e){return v(t,e,!1,[])},h.without=function(t){return h.difference(t,a.call(arguments,1))},h.uniq=h.unique=function(t,e,n,o){if(null==t)return[];h.isBoolean(e)||(o=n,n=e,e=!1),null!=n&&(n=h.iteratee(n,o));for(var i=[],r=[],a=0,s=t.length;s>a;a++){var l=t[a];if(e)a&&r===l||i.push(l),r=l;else if(n){var c=n(l,a,t);h.indexOf(r,c)<0&&(r.push(c),i.push(l))}else h.indexOf(i,l)<0&&i.push(l)}return i},h.union=function(){return h.uniq(v(arguments,!0,!0,[]))},h.intersection=function(t){if(null==t)return[];for(var e=[],n=arguments.length,o=0,i=t.length;i>o;o++){var r=t[o];if(!h.contains(e,r)){for(var a=1;n>a&&h.contains(arguments[a],r);a++);a===n&&e.push(r)}}return e},h.difference=function(t){var e=v(a.call(arguments,1),!0,!0,[]);return h.filter(t,function(t){return!h.contains(e,t)})},h.zip=function(t){if(null==t)return[];for(var e=h.max(arguments,"length").length,n=Array(e),o=0;e>o;o++)n[o]=h.pluck(arguments,o);return n},h.object=function(t,e){if(null==t)return{};for(var n={},o=0,i=t.length;i>o;o++)e?n[t[o]]=e[o]:n[t[o][0]]=t[o][1];return n},h.indexOf=function(t,e,n){if(null==t)return-1;var o=0,i=t.length;if(n){if("number"!=typeof n)return o=h.sortedIndex(t,e),t[o]===e?o:-1;o=0>n?Math.max(0,i+n):n}for(;i>o;o++)if(t[o]===e)return o;return-1},h.lastIndexOf=function(t,e,n){if(null==t)return-1;var o=t.length;for("number"==typeof n&&(o=0>n?o+n+1:Math.min(o,n+1));--o>=0;)if(t[o]===e)return o;return-1},h.range=function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=n||1;for(var o=Math.max(Math.ceil((e-t)/n),0),i=Array(o),r=0;o>r;r++,t+=n)i[r]=t;return i};var y=function(){};h.bind=function(t,e){var n,o;if(d&&t.bind===d)return d.apply(t,a.call(arguments,1));if(!h.isFunction(t))throw new TypeError("Bind must be called on a function");return n=a.call(arguments,2),o=function(){if(!(this instanceof o))return t.apply(e,n.concat(a.call(arguments)));y.prototype=t.prototype;var i=new y;y.prototype=null;var r=t.apply(i,n.concat(a.call(arguments)));return h.isObject(r)?r:i}},h.partial=function(t){var e=a.call(arguments,1);return function(){for(var n=0,o=e.slice(),i=0,r=o.length;r>i;i++)o[i]===h&&(o[i]=arguments[n++]);for(;n=o)throw new Error("bindAll must be passed function names");for(e=1;o>e;e++)n=arguments[e],t[n]=h.bind(t[n],t);return t},h.memoize=function(t,e){var n=function(o){var i=n.cache,r=e?e.apply(this,arguments):o;return h.has(i,r)||(i[r]=t.apply(this,arguments)),i[r]};return n.cache={},n},h.delay=function(t,e){var n=a.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},h.defer=function(t){return h.delay.apply(h,[t,1].concat(a.call(arguments,1)))},h.throttle=function(t,e,n){var o,i,r,a=null,s=0;n||(n={});var l=function(){s=n.leading===!1?0:h.now(),a=null,r=t.apply(o,i),a||(o=i=null)};return function(){var c=h.now();s||n.leading!==!1||(s=c);var u=e-(c-s);return o=this,i=arguments,0>=u||u>e?(clearTimeout(a),a=null,s=c,r=t.apply(o,i),a||(o=i=null)):a||n.trailing===!1||(a=setTimeout(l,u)),r}},h.debounce=function(t,e,n){var o,i,r,a,s,l=function(){var c=h.now()-a;e>c&&c>0?o=setTimeout(l,e-c):(o=null,n||(s=t.apply(r,i),o||(r=i=null)))};return function(){r=this,i=arguments,a=h.now();var c=n&&!o;return o||(o=setTimeout(l,e)),c&&(s=t.apply(r,i),r=i=null),s}},h.wrap=function(t,e){return h.partial(e,t)},h.negate=function(t){return function(){return!t.apply(this,arguments)}},h.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,o=t[e].apply(this,arguments);n--;)o=t[n].call(this,o);return o}},h.after=function(t,e){return function(){return--t<1?e.apply(this,arguments):void 0}},h.before=function(t,e){var n;return function(){return--t>0?n=e.apply(this,arguments):e=null,n}},h.once=h.partial(h.before,2),h.keys=function(t){if(!h.isObject(t))return[];if(p)return p(t);var e=[];for(var n in t)h.has(t,n)&&e.push(n);return e},h.values=function(t){for(var e=h.keys(t),n=e.length,o=Array(n),i=0;n>i;i++)o[i]=t[e[i]];return o},h.pairs=function(t){for(var e=h.keys(t),n=e.length,o=Array(n),i=0;n>i;i++)o[i]=[e[i],t[e[i]]];return o},h.invert=function(t){for(var e={},n=h.keys(t),o=0,i=n.length;i>o;o++)e[t[n[o]]]=n[o];return e},h.functions=h.methods=function(t){var e=[];for(var n in t)h.isFunction(t[n])&&e.push(n);return e.sort()},h.extend=function(t){if(!h.isObject(t))return t;for(var e,n,o=1,i=arguments.length;i>o;o++){e=arguments[o];for(n in e)c.call(e,n)&&(t[n]=e[n])}return t},h.pick=function(t,e,n){var o,i={};if(null==t)return i;if(h.isFunction(e)){e=f(e,n);for(o in t){var r=t[o];e(r,o,t)&&(i[o]=r)}}else{var l=s.apply([],a.call(arguments,1));t=new Object(t);for(var c=0,u=l.length;u>c;c++)o=l[c],o in t&&(i[o]=t[o])}return i},h.omit=function(t,e,n){if(h.isFunction(e))e=h.negate(e);else{var o=h.map(s.apply([],a.call(arguments,1)),String);e=function(t,e){return!h.contains(o,e)}}return h.pick(t,e,n)},h.defaults=function(t){if(!h.isObject(t))return t;for(var e=1,n=arguments.length;n>e;e++){var o=arguments[e];for(var i in o)void 0===t[i]&&(t[i]=o[i])}return t},h.clone=function(t){return h.isObject(t)?h.isArray(t)?t.slice():h.extend({},t):t},h.tap=function(t,e){return e(t),t};var b=function(t,e,n,o){if(t===e)return 0!==t||1/t===1/e;if(null==t||null==e)return t===e;t instanceof h&&(t=t._wrapped),e instanceof h&&(e=e._wrapped);var i=l.call(t);if(i!==l.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!==+t?+e!==+e:0===+t?1/+t===1/e:+t===+e;case"[object Date]":case"[object Boolean]":return+t===+e}if("object"!=typeof t||"object"!=typeof e)return!1;for(var r=n.length;r--;)if(n[r]===t)return o[r]===e;var a=t.constructor,s=e.constructor;if(a!==s&&"constructor"in t&&"constructor"in e&&!(h.isFunction(a)&&a instanceof a&&h.isFunction(s)&&s instanceof s))return!1;n.push(t),o.push(e);var c,u;if("[object Array]"===i){if(c=t.length,u=c===e.length)for(;c--&&(u=b(t[c],e[c],n,o)););}else{var p,d=h.keys(t);if(c=d.length,u=h.keys(e).length===c)for(;c--&&(p=d[c],u=h.has(e,p)&&b(t[p],e[p],n,o)););}return n.pop(),o.pop(),u};h.isEqual=function(t,e){return b(t,e,[],[])},h.isEmpty=function(t){if(null==t)return!0;if(h.isArray(t)||h.isString(t)||h.isArguments(t))return 0===t.length;for(var e in t)if(h.has(t,e))return!1;return!0},h.isElement=function(t){return!(!t||1!==t.nodeType)},h.isArray=u||function(t){return"[object Array]"===l.call(t)},h.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},h.each(["Arguments","Function","String","Number","Date","RegExp"],function(t){h["is"+t]=function(e){return l.call(e)==="[object "+t+"]"}}),h.isArguments(arguments)||(h.isArguments=function(t){return h.has(t,"callee")}),"function"!=typeof/./&&(h.isFunction=function(t){return"function"==typeof t||!1}),h.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},h.isNaN=function(t){return h.isNumber(t)&&t!==+t},h.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"===l.call(t)},h.isNull=function(t){return null===t},h.isUndefined=function(t){return void 0===t},h.has=function(t,e){return null!=t&&c.call(t,e)},h.noConflict=function(){return t._=e,this},h.identity=function(t){return t},h.constant=function(t){return function(){return t}},h.noop=function(){},h.property=function(t){return function(e){return e[t]}},h.matches=function(t){var e=h.pairs(t),n=e.length;return function(t){if(null==t)return!n;t=new Object(t);for(var o=0;n>o;o++){var i=e[o],r=i[0];if(i[1]!==t[r]||!(r in t))return!1}return!0}},h.times=function(t,e,n){var o=Array(Math.max(0,t));e=f(e,n,1);for(var i=0;t>i;i++)o[i]=e(i);return o},h.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},h.now=Date.now||function(){return(new Date).getTime()};var _={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},w=h.invert(_),k=function(t){var e=function(e){return t[e]},n="(?:"+h.keys(t).join("|")+")",o=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,o.test(t)?t.replace(i,e):t}};h.escape=k(_),h.unescape=k(w),h.result=function(t,e){if(null!=t){var n=t[e];return h.isFunction(n)?t[e]():n}};var x=0;h.uniqueId=function(t){var e=++x+"";return t?t+e:e},h.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,C={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},S=/\\|'|\r|\n|\u2028|\u2029/g,$=function(t){return"\\"+C[t]};h.template=function(t,e,n){!e&&n&&(e=n),e=h.defaults({},e,h.templateSettings);var o=RegExp([(e.escape||D).source,(e.interpolate||D).source,(e.evaluate||D).source].join("|")+"|$","g"),i=0,r="__p+='";t.replace(o,function(e,n,o,a,s){return r+=t.slice(i,s).replace(S,$),i=s+e.length,n?r+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":o?r+="'+\n((__t=("+o+"))==null?'':__t)+\n'":a&&(r+="';\n"+a+"\n__p+='"),e}),r+="';\n",e.variable||(r="with(obj||{}){\n"+r+"}\n"),r="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+r+"return __p;\n";try{var a=new Function(e.variable||"obj","_",r)}catch(t){throw t.source=r,t}var s=function(t){return a.call(this,t,h)},l=e.variable||"obj";return s.source="function("+l+"){\n"+r+"}",s},h.chain=function(t){var e=h(t);return e._chain=!0,e};var E=function(t){return this._chain?h(t).chain():t};h.mixin=function(t){h.each(h.functions(t),function(e){var n=h[e]=t[e];h.prototype[e]=function(){var t=[this._wrapped];return r.apply(t,arguments),E.call(this,n.apply(h,t))}})},h.mixin(h),h.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=n[t];h.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],E.call(this,n)}}),h.each(["concat","join","slice"],function(t){var e=n[t];h.prototype[t]=function(){return E.call(this,e.apply(this._wrapped,arguments))}}),h.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return h})}.call(this),function(t){t.fn.hoverIntent=function(e,n,o,i){var r={interval:i||400,sensitivity:5,timeout:600};r="object"==typeof e?t.extend(r,e):t.isFunction(n)?t.extend(r,{over:e,out:n,selector:o}):t.extend(r,{over:e,out:e,selector:n});var a,s,l,c,u=function(t){a=t.pageX,s=t.pageY},p=function(e,n){return n.hoverIntent_t=clearTimeout(n.hoverIntent_t),Math.sqrt((l-a)*(l-a)+(c-s)*(c-s))0?r.replace("/cancel",""):r+"/cancel",l="/api/"+a.type+"/"+a.id+"/"+a.do,t.post(l,function(t){0===t.status?(e.data("do",s),n?n(t):location.reload()):i&&i(t)})}}),function(t){"function"==typeof define&&define.amd?define("jquery_cookie",["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){function e(t){return s.raw?t:encodeURIComponent(t)}function n(t){return s.raw?t:decodeURIComponent(t)}function o(t){return e(s.json?JSON.stringify(t):String(t))}function i(t){0===t.indexOf('"')&&(t=t.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return t=decodeURIComponent(t.replace(a," ")),s.json?JSON.parse(t):t}catch(t){}}function r(e,n){var o=s.raw?e:i(e);return t.isFunction(n)?n(o):o}var a=/\+/g,s=t.cookie=function(i,a,l){if(void 0!==a&&!t.isFunction(a)){if(l=t.extend({},s.defaults,l),"number"==typeof l.expires){var c=l.expires,u=l.expires=new Date;u.setTime(+u+864e5*c)}return document.cookie=[e(i),"=",o(a),l.expires?"; expires="+l.expires.toUTCString():"",l.path?"; path="+l.path:"",l.domain?"; domain="+l.domain:"",l.secure?"; secure":""].join("")}for(var p=i?void 0:{},d=document.cookie?document.cookie.split("; "):[],h=0,f=d.length;hc.failure_limit)return!1}else n.trigger("appear"),e=0})}var s,l=this,c={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:e,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:SF.staticUrl+"/global/img/squares.svg"};return r&&(o!==r.failurelimit&&(r.failure_limit=r.failurelimit,delete r.failurelimit),o!==r.effectspeed&&(r.effect_speed=r.effectspeed,delete r.effectspeed),t.extend(c,r)),s=c.container===o||c.container===e?i:t(c.container),0===c.event.indexOf("scroll")&&s.bind(c.event,function(){return a()}),this.each(function(){var e=this,n=t(e);e.loaded=!1,n.attr("src")!==o&&n.attr("src")!==!1||n.is("img")&&n.attr("src",c.placeholder),n.one("appear",function(){if(!this.loaded){if(c.appear){var o=l.length;c.appear.call(e,o,c)}t("").bind("load",function(){var o=n.attr("data-"+c.data_attribute);n.hide(),n.is("img")?n.attr("src",o):n.css("background-image","url('"+o+"')"),n[c.effect](c.effect_speed),e.loaded=!0;var i=t.grep(l,function(t){return!t.loaded});if(l=t(i),c.load){var r=l.length;c.load.call(e,r,c)}}).attr("src",n.attr("data-"+c.data_attribute))}}),0!==c.event.indexOf("scroll")&&n.bind(c.event,function(){e.loaded||n.trigger("appear")})}),i.bind("resize",function(){a()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&i.bind("pageshow",function(e){e.originalEvent&&e.originalEvent.persisted&&l.each(function(){t(this).trigger("appear")})}),t(n).ready(function(){a()}),this},t.belowthefold=function(n,r){var a;return a=r.container===o||r.container===e?(e.innerHeight?e.innerHeight:i.height())+i.scrollTop():t(r.container).offset().top+t(r.container).height(),a<=t(n).offset().top-r.threshold},t.rightoffold=function(n,r){var a;return a=r.container===o||r.container===e?i.width()+i.scrollLeft():t(r.container).offset().left+t(r.container).width(),a<=t(n).offset().left-r.threshold},t.abovethetop=function(n,r){var a;return a=r.container===o||r.container===e?i.scrollTop():t(r.container).offset().top,a>=t(n).offset().top+r.threshold+t(n).height()},t.leftofbegin=function(n,r){var a;return a=r.container===o||r.container===e?i.scrollLeft():t(r.container).offset().left,a>=t(n).offset().left+r.threshold+t(n).width()},t.inviewport=function(e,n){return!(t.rightoffold(e,n)||t.leftofbegin(e,n)||t.belowthefold(e,n)||t.abovethetop(e,n))},t.extend(t.expr[":"],{"below-the-fold":function(e){return t.belowthefold(e,{threshold:0})},"above-the-top":function(e){return!t.belowthefold(e,{threshold:0})},"right-of-screen":function(e){return t.rightoffold(e,{threshold:0})},"left-of-screen":function(e){return!t.rightoffold(e,{threshold:0})},"in-viewport":function(e){return t.inviewport(e,{threshold:0})},"above-the-fold":function(e){return!t.belowthefold(e,{threshold:0})},"right-of-fold":function(e){return t.rightoffold(e,{threshold:0})},"left-of-fold":function(e){return!t.rightoffold(e,{threshold:0})}})}(jQuery,window,document),define("jquery_lazyload",["jquery"],function(t){return function(){var e;return e||t.$.fn.lazyload}}(this)),function(t){function e(e,n,o,i){var r={data:i||0===i||i===!1?i:n?n.data:{},_wrap:n?n._wrap:null,tmpl:null,parent:n||null,nodes:[],calls:c,nest:u,wrap:p,html:d,update:h};return e&&t.extend(r,e,{nodes:[],parent:n}),o&&(r.tmpl=o,r._ctnt=r._ctnt||r.tmpl(t,r),r.key=++w,(x.length?b:y)[w]=r),r}function n(e,i,r){var a,s=r?t.map(r,function(t){return"string"==typeof t?e.key?t.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+g+'="'+e.key+'" $2'):t:n(t,e,t._ctnt)}):e;return i?s:(s=s.join(""),s.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(e,n,i,r){a=t(i).get(),l(a),n&&(a=o(n).concat(a)),r&&(a=a.concat(o(r)))}),a?a:o(s))}function o(e){var n=document.createElement("div");return n.innerHTML=e,t.makeArray(n.childNodes)}function i(e){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+t.trim(e).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(e,n,o,i,r,s,l){var c,u,p,d=t.tmpl.tag[o];if(!d)throw"Unknown template tag: "+o;return c=d._default||[],s&&!/\w$/.test(r)&&(r+=s,s=""),r?(r=a(r),l=l?","+a(l)+")":s?")":"",u=s?r.indexOf(".")>-1?r+a(s):"("+r+").call($item"+l:r,p=s?u:"(typeof("+r+")==='function'?("+r+").call($item):("+r+"))"):p=u=c.$1||"null",i=a(i),"');"+d[n?"close":"open"].split("$notnull_1").join(r?"typeof("+r+")!=='undefined' && ("+r+")!=null":"true").split("$1a").join(p).split("$1").join(u).split("$2").join(i||c.$2||"")+"__.push('"})+"');}return __;")}function r(e,o){e._wrap=n(e,!0,t.isArray(o)?o:[v.test(o)?o:t(o).html()]).join("")}function a(t){return t?t.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function s(t){var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}function l(n){function o(n){function o(t){t+=c,a=u[t]=u[t]||e(a,y[a.parent.key+c]||a.parent)}var i,r,a,s,l=n;if(s=n.getAttribute(g)){for(;l.parentNode&&1===(l=l.parentNode).nodeType&&!(i=l.getAttribute(g)););i!==s&&(l=l.parentNode?11===l.nodeType?0:l.getAttribute(g)||0:0,(a=y[s])||(a=b[s],a=e(a,y[l]||b[l]),a.key=++w,y[w]=a),k&&o(s)),n.removeAttribute(g)}else k&&(a=t.data(n,"tmplItem"))&&(o(a.key),y[a.key]=a,l=t.data(n.parentNode,"tmplItem"),l=l?l.key:0);if(a){for(r=a;r&&r.key!=l;)r.nodes.push(n),r=r.parent;delete a._ctnt,delete a._wrap,t.data(n,"tmplItem",a)}}var i,r,a,s,l,c="_"+k,u={};for(a=0,s=n.length;a=0;l--)o(r[l]);o(i)}}function c(t,e,n,o){return t?void x.push({_:t,tmpl:e,item:this,data:n,options:o}):x.pop()}function u(e,n,o){return t.tmpl(t.template(e),n,o,this)}function p(e,n){var o=e.options||{};return o.wrapped=n,t.tmpl(t.template(e.tmpl),e.data,o,e.item)}function d(e,n){var o=this._wrap;return t.map(t(t.isArray(o)?o.join(""):o).filter(e||"*"),function(t){return n?t.innerText||t.textContent:t.outerHTML||s(t)})}function h(){var e=this.nodes;t.tmpl(null,null,null,this).insertBefore(e[0]),t(e).remove()}var f,m=t.fn.domManip,g="_tmplitem",v=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,y={},b={},_={key:0,data:{}},w=0,k=0,x=[];t.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,n){t.fn[e]=function(o){var i,r,a,s,l=[],c=t(o),u=1===this.length&&this[0].parentNode;if(f=y||{},u&&11===u.nodeType&&1===u.childNodes.length&&1===c.length)c[n](this[0]),l=this;else{for(r=0,a=c.length;r0?this.clone(!0):this).get(),t(c[r])[n](i),l=l.concat(i);k=0,l=this.pushStack(l,e,c.selector)}return s=f,f=null,t.tmpl.complete(s),l}}),t.fn.extend({tmpl:function(e,n,o){return t.tmpl(this[0],e,n,o)},tmplItem:function(){return t.tmplItem(this[0])},template:function(e){return t.template(e,this[0])},domManip:function(e,n,o){if(e[0]&&t.isArray(e[0])){for(var i,r=t.makeArray(arguments),a=e[0],s=a.length,l=0;l").join(">").split('"').join(""").split("'").join("'")}}),t.extend(t.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},if:{open:"if(($notnull_1) && $1a){",close:"}"},else:{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){" },html:{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(){y={}},afterManip:function(e,n,o){var i=11===n.nodeType?t.makeArray(n.childNodes):1===n.nodeType?[n]:[];o.call(e,n),l(i),k++}})}(jQuery),define("jquery_tmpl",["jquery"],function(t){return function(){var e;return e||t.$.fn.tmpl}}(this)),define("typeHelper",["jquery","jquery_tmpl"],function(t){"use strict";var e,n,o,i,r,a,s,l;s='',i=void 0,e=void 0,o=void 0,n=void 0,r=void 0,a=["gmail.com","qq.com","163.com","hotmail.com","sina.com","126.com","live.com","live.cn","vip.sina.com","vip.qq.com","sina.cn","sohu.com","139.com","wo.com.cn","189.cn","21cn.com"],l='×',t.fn.typeHelperOld=function(c){var u;i=t.extend({data:null,tpl:'
  • ${name}
  • ',defaultList:[],showNum:5,remoteData:null,submitKey:null,onlyResult:!0,autoSelect:!0,emailMode:!1,insertHandler:function(){}},c),u=[],n=t(this),0!==n.length&&(n.after(t("
    ").addClass("typehelper")).siblings(".typehelper").append(n),e=n.parent().css("position","relative"),t.tmpl(s).insertAfter(n),o=e.find("ul").hide().css("minWidth",n.outerWidth()),t.each(i.defaultList,function(e,n){t.tmpl(i.tpl,n).appendTo(o)}),n.on("focus",function(){i.defaultList.length>0&&t(this).parent().trigger("show.typehelper")}),n.on("input",function(e){n.is(":focus")&&(t(this).parent().trigger("search.typehelper"),t(this).parent().trigger("show.typehelper"))}),n.on("keydown",function(e){t(this).parent().trigger("select.typehelper",e)}),o.delegate("li","mouseover",function(){t(this).siblings("li").removeClass("active"),t(this).addClass("active")}),n.on("blur",function(){var e,n;t(this).parent().trigger("hide.typehelper"),i.autoSelect&&(t(this).siblings("ul").find(".active").length>0?(e=o.find(".active").index(),n=u[e],t(this).parent().trigger("insert.typehelper",[o.find(".active a"),n])):t(this).val(""))}),e.on("show.typehelper",function(){t(this).find("ul").show()}),e.on("hide.typehelper",function(){t(this).find("ul").hide()}),e.on("insert.typehelper",function(r,a,s){e=t(this),n=e.find("input"),o=e.find("ul"),n.val(t(a).data("value")),t(".result",e).length>0&&(t(".result",e).remove(),e.find(".delete-result").remove()),i.onlyResult&&(n.hide(),o.after(t.tmpl(l,{result:n.val()})),i.submitKey&&n.data(i.submitKey,t(a).data(i.submitKey)),e.find(".result").on("click",function(){t(this).siblings(".delete-result").remove(),t(this).remove(),n.show().focus(),e.trigger("search.typehelper")}),e.find(".delete-result").on("click",function(){return t(this).siblings(".result").remove(),t(this).remove(),n.val("").show(),!1})),e.parents(".form-group").next(".form-group").find("input").focus(),i.insertHandler(s)}),e.on("select.typehelper",function(i,r){var a,s,l,c,p,d;if(e=t(this),n=e.find("input"),o=e.find("ul"),a=o.find("li"),r)switch(r.keyCode){case 9:r.shiftKey||(r.preventDefault(),e.parent(".form-group").next(".form-group").find("input").focus());break;case 38:r.preventDefault(),a.length&&(o.find(".active").length?o.find(".active").removeClass("active").prev("li").addClass("active"):a.last().addClass("active"));break;case 40:r.preventDefault(),a.length&&(o.find(".active").length?o.find(".active").removeClass("active").next("li").addClass("active"):a.first().addClass("active"));break;case 13:if(r.stopPropagation(),r.preventDefault(),o.find(".active").length<=0)return;c=o.find(".active").index(),d=u[c],e.trigger("insert.typehelper",[o.find(".active a"),d]),e.trigger("hide.typehelper");break;case 9:s=t(this).parents("form").find("input"),l=s.index(t("input:focus")),l!==-1&&(p=s.slice(l+1),p.length&&p.each(function(){var e,n;if(n=t(this).attr("type"),e=["text","email","password","url"],!t(this).val()&&e.indexOf(n)!==-1)return t(this).focus(),!1}));break;case 27:r.preventDefault();break;default:return}}),e.on("search.typehelper",function(){var s,l,c,p;if(e=t(this),n=e.find("input"),o=e.find("ul"),n.val().length)if(c=[],i.remoteData)i.remoteData(n.val(),function(e){u=e,c=e,c.length>0&&(o.children().remove(),t.tmpl(i.tpl,c).appendTo(o),1===c.length&&o.children().first().addClass("active"))});else{for(p=0,i.emailMode&&(i.data=[{name:n.val()}],t.each(a,function(t,e){n.val().split("@")[1]!=e&&i.data.push({name:n.val().replace(/@.*$/,"")+"@"+e})})),r=i.data.length,l=0;l=i.showNum)));)l++;c.length>0&&(o.children().remove(),t.tmpl(i.tpl,c).appendTo(o),(1===c.length||i.emailMode)&&o.children().first().addClass("active"))}}),n.val().length>0&&e.trigger("insert.typehelper",n))}}),function(t){"function"==typeof define&&define.amd?define("jquery-mousewheel",["jquery"],t):"object"==typeof exports?module.exports=t:t(jQuery)}(function(t){function e(e){var a=e||window.event,s=l.call(arguments,1),c=0,p=0,d=0,h=0,f=0,m=0;if(e=t.event.fix(a),e.type="mousewheel","detail"in a&&(d=a.detail*-1),"wheelDelta"in a&&(d=a.wheelDelta),"wheelDeltaY"in a&&(d=a.wheelDeltaY),"wheelDeltaX"in a&&(p=a.wheelDeltaX*-1),"axis"in a&&a.axis===a.HORIZONTAL_AXIS&&(p=d*-1,d=0),c=0===d?p:d,"deltaY"in a&&(d=a.deltaY*-1,c=d),"deltaX"in a&&(p=a.deltaX,0===d&&(c=p*-1)),0!==d||0!==p){if(1===a.deltaMode){var g=t.data(this,"mousewheel-line-height");c*=g,d*=g,p*=g}else if(2===a.deltaMode){var v=t.data(this,"mousewheel-page-height");c*=v,d*=v,p*=v}if(h=Math.max(Math.abs(d),Math.abs(p)),(!r||h=1?"floor":"ceil"](c/r),p=Math[p>=1?"floor":"ceil"](p/r),d=Math[d>=1?"floor":"ceil"](d/r),u.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();f=e.clientX-y.left,m=e.clientY-y.top}return e.deltaX=p,e.deltaY=d,e.deltaFactor=r,e.offsetX=f,e.offsetY=m,e.deltaMode=0,s.unshift(e,c,p,d),i&&clearTimeout(i),i=setTimeout(n,200),(t.event.dispatch||t.event.handle).apply(this,s)}}function n(){r=null}function o(t,e){return u.settings.adjustOldDeltas&&"mousewheel"===t.type&&e%120===0}var i,r,a=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],s="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(t.event.fixHooks)for(var c=a.length;c;)t.event.fixHooks[a[--c]]=t.event.mouseHooks;var u=t.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var n=s.length;n;)this.addEventListener(s[--n],e,!1);else this.onmousewheel=e;t.data(this,"mousewheel-line-height",u.getLineHeight(this)),t.data(this,"mousewheel-page-height",u.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var n=s.length;n;)this.removeEventListener(s[--n],e,!1);else this.onmousewheel=null;t.removeData(this,"mousewheel-line-height"),t.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var n=t(e),o=n["offsetParent"in t.fn?"offsetParent":"parent"]();return o.length||(o=t("body")),parseInt(o.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(e){return t(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};t.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})}),function(t){"undefined"!=typeof module&&module.exports?module.exports=t:t(jQuery,window,document)}(function(t){!function(e){var n="function"==typeof define&&define.amd,o="undefined"!=typeof module&&module.exports,i="https:"==document.location.protocol?"https:":"http:",r="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js";n||(o?require("jquery-mousewheel")(t):t.event.special.mousewheel||t("head").append(decodeURI("%3Cscript src="+i+"//"+r+"%3E%3C/script%3E"))),e()}(function(){var e,n="mCustomScrollbar",o="mCS",i=".mCustomScrollbar",r={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},a=0,s={},l=window.attachEvent&&!window.addEventListener?1:0,c=!1,u=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],p={init:function(e){var e=t.extend(!0,{},r,e),n=d.call(this);if(e.live){var l=e.liveSelector||this.selector||i,c=t(l);if("off"===e.live)return void f(l);s[l]=setTimeout(function(){c.mCustomScrollbar(e),"once"===e.live&&c.length&&f(l)},500)}else f(l);return e.setWidth=e.set_width?e.set_width:e.setWidth,e.setHeight=e.set_height?e.set_height:e.setHeight,e.axis=e.horizontalScroll?"x":m(e.axis),e.scrollInertia=e.scrollInertia>0&&e.scrollInertia<17?17:e.scrollInertia,"object"!=typeof e.mouseWheel&&1==e.mouseWheel&&(e.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),e.mouseWheel.scrollAmount=e.mouseWheelPixels?e.mouseWheelPixels:e.mouseWheel.scrollAmount,e.mouseWheel.normalizeDelta=e.advanced.normalizeMouseWheelDelta?e.advanced.normalizeMouseWheelDelta:e.mouseWheel.normalizeDelta,e.scrollButtons.scrollType=g(e.scrollButtons.scrollType),h(e),t(n).each(function(){var n=t(this);if(!n.data(o)){n.data(o,{idx:++a,opt:e,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:n.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var i=n.data(o),r=i.opt,s=n.data("mcs-axis"),l=n.data("mcs-scrollbar-position"),c=n.data("mcs-theme");s&&(r.axis=s),l&&(r.scrollbarPosition=l),c&&(r.theme=c,h(r)),v.call(this),i&&r.callbacks.onCreate&&"function"==typeof r.callbacks.onCreate&&r.callbacks.onCreate.call(this),t("#mCSB_"+i.idx+"_container img:not(."+u[2]+")").addClass(u[2]),p.update.call(null,n)}})},update:function(e,n){var i=e||d.call(this);return t(i).each(function(){var e=t(this);if(e.data(o)){var i=e.data(o),r=i.opt,a=t("#mCSB_"+i.idx+"_container"),s=t("#mCSB_"+i.idx),l=[t("#mCSB_"+i.idx+"_dragger_vertical"),t("#mCSB_"+i.idx+"_dragger_horizontal")];if(!a.length)return;i.tweenRunning&&Y(e),n&&i&&r.callbacks.onBeforeUpdate&&"function"==typeof r.callbacks.onBeforeUpdate&&r.callbacks.onBeforeUpdate.call(this),e.hasClass(u[3])&&e.removeClass(u[3]),e.hasClass(u[4])&&e.removeClass(u[4]),s.css("max-height","none"),s.height()!==e.height()&&s.css("max-height",e.height()),b.call(this),"y"===r.axis||r.advanced.autoExpandHorizontalScroll||a.css("width",y(a)),i.overflowed=D.call(this),E.call(this),r.autoDraggerLength&&w.call(this),k.call(this),S.call(this);var c=[Math.abs(a[0].offsetTop),Math.abs(a[0].offsetLeft)];"x"!==r.axis&&(i.overflowed[0]?l[0].height()>l[0].parent().height()?C.call(this):(X(e,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}),i.contentReset.y=null):(C.call(this),"y"===r.axis?$.call(this):"yx"===r.axis&&i.overflowed[1]&&X(e,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==r.axis&&(i.overflowed[1]?l[1].width()>l[1].parent().width()?C.call(this):(X(e,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}),i.contentReset.x=null):(C.call(this),"x"===r.axis?$.call(this):"yx"===r.axis&&i.overflowed[0]&&X(e,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),n&&i&&(2===n&&r.callbacks.onImageLoad&&"function"==typeof r.callbacks.onImageLoad?r.callbacks.onImageLoad.call(this):3===n&&r.callbacks.onSelectorChange&&"function"==typeof r.callbacks.onSelectorChange?r.callbacks.onSelectorChange.call(this):r.callbacks.onUpdate&&"function"==typeof r.callbacks.onUpdate&&r.callbacks.onUpdate.call(this)),H.call(this)}})},scrollTo:function(e,n){if("undefined"!=typeof e&&null!=e){var i=d.call(this);return t(i).each(function(){var i=t(this);if(i.data(o)){var r=i.data(o),a=r.opt,s={trigger:"external",scrollInertia:a.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},l=t.extend(!0,{},s,n),c=U.call(this,e),u=l.scrollInertia>0&&l.scrollInertia<17?17:l.scrollInertia;c[0]=z.call(this,c[0],"y"),c[1]=z.call(this,c[1],"x"),l.moveDragger&&(c[0]*=r.scrollRatio.y,c[1]*=r.scrollRatio.x),l.dur=nt()?0:u,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==a.axis&&r.overflowed[0]&&(l.dir="y",l.overwrite="all",X(i,c[0].toString(),l)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==a.axis&&r.overflowed[1]&&(l.dir="x",l.overwrite="none",X(i,c[1].toString(),l))},l.timeout)}})}},stop:function(){var e=d.call(this);return t(e).each(function(){var e=t(this);e.data(o)&&Y(e)})},disable:function(e){var n=d.call(this);return t(n).each(function(){var n=t(this);if(n.data(o)){n.data(o);H.call(this,"remove"),$.call(this),e&&C.call(this),E.call(this,!0),n.addClass(u[3])}})},destroy:function(){var e=d.call(this);return t(e).each(function(){var i=t(this);if(i.data(o)){var r=i.data(o),a=r.opt,s=t("#mCSB_"+r.idx),l=t("#mCSB_"+r.idx+"_container"),c=t(".mCSB_"+r.idx+"_scrollbar");a.live&&f(a.liveSelector||t(e).selector),H.call(this,"remove"),$.call(this),C.call(this),i.removeData(o),G(this,"mcs"),c.remove(),l.find("img."+u[2]).removeClass(u[2]),s.replaceWith(l.contents()),i.removeClass(n+" _"+o+"_"+r.idx+" "+u[6]+" "+u[7]+" "+u[5]+" "+u[3]).addClass(u[4])}})}},d=function(){return"object"!=typeof t(this)||t(this).length<1?i:this},h=function(e){var n=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],o=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],i=["minimal","minimal-dark"],r=["minimal","minimal-dark"],a=["minimal","minimal-dark"];e.autoDraggerLength=!(t.inArray(e.theme,n)>-1)&&e.autoDraggerLength,e.autoExpandScrollbar=!(t.inArray(e.theme,o)>-1)&&e.autoExpandScrollbar,e.scrollButtons.enable=!(t.inArray(e.theme,i)>-1)&&e.scrollButtons.enable,e.autoHideScrollbar=t.inArray(e.theme,r)>-1||e.autoHideScrollbar,e.scrollbarPosition=t.inArray(e.theme,a)>-1?"outside":e.scrollbarPosition},f=function(t){s[t]&&(clearTimeout(s[t]),G(s,t))},m=function(t){return"yx"===t||"xy"===t||"auto"===t?"yx":"x"===t||"horizontal"===t?"x":"y"},g=function(t){return"stepped"===t||"pixels"===t||"step"===t||"click"===t?"stepped":"stepless"},v=function(){var e=t(this),i=e.data(o),r=i.opt,a=r.autoExpandScrollbar?" "+u[1]+"_expand":"",s=["
    ","
    "],l="yx"===r.axis?"mCSB_vertical_horizontal":"x"===r.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===r.axis?s[0]+s[1]:"x"===r.axis?s[1]:s[0],p="yx"===r.axis?"
    ":"",d=r.autoHideScrollbar?" "+u[6]:"",h="x"!==r.axis&&"rtl"===i.langDir?" "+u[7]:"";r.setWidth&&e.css("width",r.setWidth),r.setHeight&&e.css("height",r.setHeight),r.setLeft="y"!==r.axis&&"rtl"===i.langDir?"989999px":r.setLeft,e.addClass(n+" _"+o+"_"+i.idx+d+h).wrapInner("
    ");var f=t("#mCSB_"+i.idx),m=t("#mCSB_"+i.idx+"_container");"y"===r.axis||r.advanced.autoExpandHorizontalScroll||m.css("width",y(m)),"outside"===r.scrollbarPosition?("static"===e.css("position")&&e.css("position","relative"),e.css("overflow","visible"),f.addClass("mCSB_outside").after(c)):(f.addClass("mCSB_inside").append(c),m.wrap(p)),_.call(this);var g=[t("#mCSB_"+i.idx+"_dragger_vertical"),t("#mCSB_"+i.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},y=function(e){var n=[e[0].scrollWidth,Math.max.apply(Math,e.children().map(function(){return t(this).outerWidth(!0)}).get())],o=e.parent().width();return n[0]>o?n[0]:n[1]>o?n[1]:"100%"},b=function(){var e=t(this),n=e.data(o),i=n.opt,r=t("#mCSB_"+n.idx+"_container");if(i.advanced.autoExpandHorizontalScroll&&"y"!==i.axis){r.css({width:"auto","min-width":0,"overflow-x":"scroll"});var a=Math.ceil(r[0].scrollWidth);3===i.advanced.autoExpandHorizontalScroll||2!==i.advanced.autoExpandHorizontalScroll&&a>r.parent().width()?r.css({width:a,"min-width":"100%","overflow-x":"inherit"}):r.css({"overflow-x":"inherit",position:"absolute"}).wrap("
    ").css({width:Math.ceil(r[0].getBoundingClientRect().right+.4)-Math.floor(r[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap()}},_=function(){var e=t(this),n=e.data(o),i=n.opt,r=t(".mCSB_"+n.idx+"_scrollbar:first"),a=tt(i.scrollButtons.tabindex)?"tabindex='"+i.scrollButtons.tabindex+"'":"",s=["","","",""],l=["x"===i.axis?s[2]:s[0],"x"===i.axis?s[3]:s[1],s[2],s[3]];i.scrollButtons.enable&&r.prepend(l[0]).append(l[1]).next(".mCSB_scrollTools").prepend(l[2]).append(l[3])},w=function(){var e=t(this),n=e.data(o),i=t("#mCSB_"+n.idx),r=t("#mCSB_"+n.idx+"_container"),a=[t("#mCSB_"+n.idx+"_dragger_vertical"),t("#mCSB_"+n.idx+"_dragger_horizontal")],s=[i.height()/r.outerHeight(!1),i.width()/r.outerWidth(!1)],c=[parseInt(a[0].css("min-height")),Math.round(s[0]*a[0].parent().height()),parseInt(a[1].css("min-width")),Math.round(s[1]*a[1].parent().width())],u=l&&c[1]a&&(a=l),c>s&&(s=c),[a>i.height(),s>i.width()]},C=function(){var e=t(this),n=e.data(o),i=n.opt,r=t("#mCSB_"+n.idx),a=t("#mCSB_"+n.idx+"_container"),s=[t("#mCSB_"+n.idx+"_dragger_vertical"),t("#mCSB_"+n.idx+"_dragger_horizontal")];if(Y(e),("x"!==i.axis&&!n.overflowed[0]||"y"===i.axis&&n.overflowed[0])&&(s[0].add(a).css("top",0),X(e,"_resetY")),"y"!==i.axis&&!n.overflowed[1]||"x"===i.axis&&n.overflowed[1]){var l=dx=0;"rtl"===n.langDir&&(l=r.width()-a.outerWidth(!1),dx=Math.abs(l/n.scrollRatio.x)),a.css("left",l),s[1].css("left",dx),X(e,"_resetX")}},S=function(){function e(){a=setTimeout(function(){t.event.special.mousewheel?(clearTimeout(a),I.call(n[0])):e()},100)}var n=t(this),i=n.data(o),r=i.opt;if(!i.bindEvents){if(T.call(this),r.contentTouchScroll&&P.call(this),B.call(this),r.mouseWheel.enable){var a;e()}j.call(this),M.call(this),r.advanced.autoScrollOnFocus&&O.call(this),r.scrollButtons.enable&&R.call(this),r.keyboard.enable&&q.call(this),i.bindEvents=!0}},$=function(){var e=t(this),n=e.data(o),i=n.opt,r=o+"_"+n.idx,a=".mCSB_"+n.idx+"_scrollbar",s=t("#mCSB_"+n.idx+",#mCSB_"+n.idx+"_container,#mCSB_"+n.idx+"_container_wrapper,"+a+" ."+u[12]+",#mCSB_"+n.idx+"_dragger_vertical,#mCSB_"+n.idx+"_dragger_horizontal,"+a+">a"),l=t("#mCSB_"+n.idx+"_container");i.advanced.releaseDraggableSelectors&&s.add(t(i.advanced.releaseDraggableSelectors)),i.advanced.extraDraggableSelectors&&s.add(t(i.advanced.extraDraggableSelectors)),n.bindEvents&&(t(document).add(t(!L()||top.document)).unbind("."+r),s.each(function(){t(this).unbind("."+r)}),clearTimeout(e[0]._focusTimeout),G(e[0],"_focusTimeout"),clearTimeout(n.sequential.step),G(n.sequential,"step"),clearTimeout(l[0].onCompleteTimeout),G(l[0],"onCompleteTimeout"),n.bindEvents=!1)},E=function(e){var n=t(this),i=n.data(o),r=i.opt,a=t("#mCSB_"+i.idx+"_container_wrapper"),s=a.length?a:t("#mCSB_"+i.idx+"_container"),l=[t("#mCSB_"+i.idx+"_scrollbar_vertical"),t("#mCSB_"+i.idx+"_scrollbar_horizontal")],c=[l[0].find(".mCSB_dragger"),l[1].find(".mCSB_dragger")];"x"!==r.axis&&(i.overflowed[0]&&!e?(l[0].add(c[0]).add(l[0].children("a")).css("display","block"),s.removeClass(u[8]+" "+u[10])):(r.alwaysShowScrollbar?(2!==r.alwaysShowScrollbar&&c[0].css("display","none"),s.removeClass(u[10])):(l[0].css("display","none"),s.addClass(u[10])),s.addClass(u[8]))),"y"!==r.axis&&(i.overflowed[1]&&!e?(l[1].add(c[1]).add(l[1].children("a")).css("display","block"),s.removeClass(u[9]+" "+u[11])):(r.alwaysShowScrollbar?(2!==r.alwaysShowScrollbar&&c[1].css("display","none"),s.removeClass(u[11])):(l[1].css("display","none"),s.addClass(u[11])),s.addClass(u[9]))),i.overflowed[0]||i.overflowed[1]?n.removeClass(u[5]):n.addClass(u[5])},A=function(e){var n=e.type,o=e.target.ownerDocument!==document?[t(frameElement).offset().top,t(frameElement).offset().left]:null,i=L()&&e.target.ownerDocument!==top.document?[t(e.view.frameElement).offset().top,t(e.view.frameElement).offset().left]:[0,0];switch(n){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return o?[e.originalEvent.pageY-o[0]+i[0],e.originalEvent.pageX-o[1]+i[1],!1]:[e.originalEvent.pageY,e.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var r=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],a=e.originalEvent.touches.length||e.originalEvent.changedTouches.length;return e.target.ownerDocument!==document?[r.screenY,r.screenX,a>1]:[r.pageY,r.pageX,a>1];default:return o?[e.pageY-o[0]+i[0],e.pageX-o[1]+i[1],!1]:[e.pageY,e.pageX,!1]}},T=function(){function e(t){var e=f.find("iframe");if(e.length){var n=t?"auto":"none";e.css("pointer-events",n)}}function n(t,e,n,o){if(f[0].idleTimer=p.scrollInertia<233?250:0,i.attr("id")===h[1])var r="x",a=(i[0].offsetLeft-e+o)*u.scrollRatio.x;else var r="y",a=(i[0].offsetTop-t+n)*u.scrollRatio.y;X(s,a.toString(),{dir:r,drag:!0})}var i,r,a,s=t(this),u=s.data(o),p=u.opt,d=o+"_"+u.idx,h=["mCSB_"+u.idx+"_dragger_vertical","mCSB_"+u.idx+"_dragger_horizontal"],f=t("#mCSB_"+u.idx+"_container"),m=t("#"+h[0]+",#"+h[1]),g=p.advanced.releaseDraggableSelectors?m.add(t(p.advanced.releaseDraggableSelectors)):m,v=p.advanced.extraDraggableSelectors?t(!L()||top.document).add(t(p.advanced.extraDraggableSelectors)):t(!L()||top.document);m.bind("mousedown."+d+" touchstart."+d+" pointerdown."+d+" MSPointerDown."+d,function(n){if(n.stopImmediatePropagation(),n.preventDefault(),Q(n)){c=!0,l&&(document.onselectstart=function(){return!1}),e(!1),Y(s),i=t(this);var o=i.offset(),u=A(n)[0]-o.top,d=A(n)[1]-o.left,h=i.height()+o.top,f=i.width()+o.left;u0&&d0&&(r=u,a=d),x(i,"active",p.autoExpandScrollbar)}}).bind("touchmove."+d,function(t){t.stopImmediatePropagation(),t.preventDefault();var e=i.offset(),o=A(t)[0]-e.top,s=A(t)[1]-e.left;n(r,a,o,s)}),t(document).add(v).bind("mousemove."+d+" pointermove."+d+" MSPointerMove."+d,function(t){if(i){var e=i.offset(),o=A(t)[0]-e.top,s=A(t)[1]-e.left;if(r===o&&a===s)return;n(r,a,o,s)}}).add(g).bind("mouseup."+d+" touchend."+d+" pointerup."+d+" MSPointerUp."+d,function(t){i&&(x(i,"active",p.autoExpandScrollbar),i=null),c=!1,l&&(document.onselectstart=null),e(!0)})},P=function(){function n(t){if(!Z(t)||c||A(t)[2])return void(e=0);e=1,k=0,x=0,u=1,D.removeClass("mCS_touch_action");var n=T.offset();p=A(t)[0]-n.top,d=A(t)[1]-n.left,O=[A(t)[0],A(t)[1]]}function i(t){if(Z(t)&&!c&&!A(t)[2]&&(S.documentTouchScroll||t.preventDefault(),t.stopImmediatePropagation(),(!x||k)&&u)){g=K();var e=E.offset(),n=A(t)[0]-e.top,o=A(t)[1]-e.left,i="mcsLinearOut";if(B.push(n),I.push(o),O[2]=Math.abs(A(t)[0]-O[0]),O[3]=Math.abs(A(t)[1]-O[1]),C.overflowed[0])var r=P[0].parent().height()-P[0].height(),a=p-n>0&&n-p>-(r*C.scrollRatio.y)&&(2*O[3]0&&o-d>-(s*C.scrollRatio.x)&&(2*O[2]30)){b=1e3/(v-m);var i="mcsEaseOut",r=b<2.5,a=r?[B[B.length-2],I[I.length-2]]:[0,0];y=r?[n-a[0],o-a[1]]:[n-h,o-f];var p=[Math.abs(y[0]),Math.abs(y[1])];b=r?[Math.abs(y[0]/4),Math.abs(y[1]/4)]:[b,b];var d=[Math.abs(T[0].offsetTop)-y[0]*s(p[0]/b[0],b[0]),Math.abs(T[0].offsetLeft)-y[1]*s(p[1]/b[1],b[1])];_="yx"===S.axis?[d[0],d[1]]:"x"===S.axis?[null,d[1]]:[d[0],null],w=[4*p[0]+S.scrollInertia,4*p[1]+S.scrollInertia];var D=parseInt(S.contentTouchScroll)||0;_[0]=p[0]>D?_[0]:0,_[1]=p[1]>D?_[1]:0,C.overflowed[0]&&l(_[0],w[0],i,"y",j,!1),C.overflowed[1]&&l(_[1],w[1],i,"x",j,!1)}}}function s(t,e){var n=[1.5*e,2*e,e/1.5,e/2];return t>90?e>4?n[0]:n[3]:t>60?e>3?n[3]:n[2]:t>30?e>8?n[1]:e>6?n[0]:e>4?e:n[2]:e>8?e:n[3]}function l(t,e,n,o,i,r){t&&X(D,t.toString(),{dur:e,scrollEasing:n,dir:o,overwrite:i,drag:r})}var u,p,d,h,f,m,g,v,y,b,_,w,k,x,D=t(this),C=D.data(o),S=C.opt,$=o+"_"+C.idx,E=t("#mCSB_"+C.idx),T=t("#mCSB_"+C.idx+"_container"),P=[t("#mCSB_"+C.idx+"_dragger_vertical"),t("#mCSB_"+C.idx+"_dragger_horizontal")],B=[],I=[],F=0,j="yx"===S.axis?"none":"all",O=[],M=T.find("iframe"),R=["touchstart."+$+" pointerdown."+$+" MSPointerDown."+$,"touchmove."+$+" pointermove."+$+" MSPointerMove."+$,"touchend."+$+" pointerup."+$+" MSPointerUp."+$],q=void 0!==document.body.style.touchAction;T.bind(R[0],function(t){n(t)}).bind(R[1],function(t){i(t)}),E.bind(R[0],function(t){r(t)}).bind(R[2],function(t){a(t)}),M.length&&M.each(function(){t(this).load(function(){L(this)&&t(this.contentDocument||this.contentWindow.document).bind(R[0],function(t){n(t),r(t)}).bind(R[1],function(t){i(t)}).bind(R[2],function(t){a(t)})})})},B=function(){function n(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function i(t,e,n){u.type=n&&r?"stepped":"stepless",u.scrollAmount=10,N(a,t,e,"mcsLinearOut",n?60:null)}var r,a=t(this),s=a.data(o),l=s.opt,u=s.sequential,p=o+"_"+s.idx,d=t("#mCSB_"+s.idx+"_container"),h=d.parent();d.bind("mousedown."+p,function(t){e||r||(r=1,c=!0)}).add(document).bind("mousemove."+p,function(t){if(!e&&r&&n()){var o=d.offset(),a=A(t)[0]-o.top+d[0].offsetTop,c=A(t)[1]-o.left+d[0].offsetLeft;a>0&&a0&&ch.height()&&i("on",40)),"y"!==l.axis&&s.overflowed[1]&&(c<0?i("on",37):c>h.width()&&i("on",39)))}}).bind("mouseup."+p+" dragend."+p,function(t){e||(r&&(r=0,i("off",null)),c=!1)})},I=function(){function e(e,o){if(Y(n),!F(n,e.target)){var a="auto"!==r.mouseWheel.deltaFactor?parseInt(r.mouseWheel.deltaFactor):l&&e.deltaFactor<100?100:e.deltaFactor||100,u=r.scrollInertia;if("x"===r.axis||"x"===r.mouseWheel.axis)var p="x",d=[Math.round(a*i.scrollRatio.x),parseInt(r.mouseWheel.scrollAmount)],h="auto"!==r.mouseWheel.scrollAmount?d[1]:d[0]>=s.width()?.9*s.width():d[0],f=Math.abs(t("#mCSB_"+i.idx+"_container")[0].offsetLeft),m=c[1][0].offsetLeft,g=c[1].parent().width()-c[1].width(),v=e.deltaX||e.deltaY||o;else var p="y",d=[Math.round(a*i.scrollRatio.y),parseInt(r.mouseWheel.scrollAmount)],h="auto"!==r.mouseWheel.scrollAmount?d[1]:d[0]>=s.height()?.9*s.height():d[0],f=Math.abs(t("#mCSB_"+i.idx+"_container")[0].offsetTop),m=c[0][0].offsetTop,g=c[0].parent().height()-c[0].height(),v=e.deltaY||o;"y"===p&&!i.overflowed[0]||"x"===p&&!i.overflowed[1]||((r.mouseWheel.invert||e.webkitDirectionInvertedFromDevice)&&(v=-v),r.mouseWheel.normalizeDelta&&(v=v<0?-1:1),(v>0&&0!==m||v<0&&m!==g||r.mouseWheel.preventDefault)&&(e.stopImmediatePropagation(),e.preventDefault()),e.deltaFactor<2&&!r.mouseWheel.normalizeDelta&&(h=e.deltaFactor,u=17),X(n,(f-v*h).toString(),{dir:p,dur:u}))}}if(t(this).data(o)){var n=t(this),i=n.data(o),r=i.opt,a=o+"_"+i.idx,s=t("#mCSB_"+i.idx),c=[t("#mCSB_"+i.idx+"_dragger_vertical"),t("#mCSB_"+i.idx+"_dragger_horizontal")],u=t("#mCSB_"+i.idx+"_container").find("iframe");u.length&&u.each(function(){t(this).load(function(){L(this)&&t(this.contentDocument||this.contentWindow.document).bind("mousewheel."+a,function(t,n){e(t,n)})})}),s.bind("mousewheel."+a,function(t,n){e(t,n)})}},L=function(t){var e=null;if(t){try{var n=t.contentDocument||t.contentWindow.document;e=n.body.innerHTML}catch(t){}return null!==e}try{var n=top.document;e=n.body.innerHTML}catch(t){}return null!==e},F=function(e,n){var i=n.nodeName.toLowerCase(),r=e.data(o).opt.mouseWheel.disableOver,a=["select","textarea"];return t.inArray(i,r)>-1&&!(t.inArray(i,a)>-1&&!t(n).is(":focus"))},j=function(){var e,n=t(this),i=n.data(o),r=o+"_"+i.idx,a=t("#mCSB_"+i.idx+"_container"),s=a.parent(),l=t(".mCSB_"+i.idx+"_scrollbar ."+u[12]);l.bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r,function(n){c=!0,t(n.target).hasClass("mCSB_dragger")||(e=1)}).bind("touchend."+r+" pointerup."+r+" MSPointerUp."+r,function(t){c=!1}).bind("click."+r,function(o){if(e&&(e=0,t(o.target).hasClass(u[12])||t(o.target).hasClass("mCSB_draggerRail"))){Y(n);var r=t(this),l=r.find(".mCSB_dragger");if(r.parent(".mCSB_scrollTools_horizontal").length>0){if(!i.overflowed[1])return;var c="x",p=o.pageX>l.offset().left?-1:1,d=Math.abs(a[0].offsetLeft)-p*(.9*s.width())}else{if(!i.overflowed[0])return;var c="y",p=o.pageY>l.offset().top?-1:1,d=Math.abs(a[0].offsetTop)-p*(.9*s.height())}X(n,d.toString(),{dir:c,scrollEasing:"mcsEaseInOut"})}})},O=function(){var e=t(this),n=e.data(o),i=n.opt,r=o+"_"+n.idx,a=t("#mCSB_"+n.idx+"_container"),s=a.parent();a.bind("focusin."+r,function(n){var o=t(document.activeElement),r=a.find(".mCustomScrollBox").length,l=0; o.is(i.advanced.autoScrollOnFocus)&&(Y(e),clearTimeout(e[0]._focusTimeout),e[0]._focusTimer=r?(l+17)*r:0,e[0]._focusTimeout=setTimeout(function(){var t=[et(o)[0],et(o)[1]],n=[a[0].offsetTop,a[0].offsetLeft],r=[n[0]+t[0]>=0&&n[0]+t[0]=0&&n[0]+t[1]a");l.bind("mousedown."+a+" touchstart."+a+" pointerdown."+a+" MSPointerDown."+a+" mouseup."+a+" touchend."+a+" pointerup."+a+" MSPointerUp."+a+" mouseout."+a+" pointerout."+a+" MSPointerOut."+a+" click."+a,function(o){function a(t,n){r.scrollAmount=i.scrollButtons.scrollAmount,N(e,t,n)}if(o.preventDefault(),Q(o)){var s=t(this).attr("class");switch(r.type=i.scrollButtons.scrollType,o.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===r.type)return;c=!0,n.tweenRunning=!1,a("on",s);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===r.type)return;c=!1,r.dir&&a("off",s);break;case"click":if("stepped"!==r.type||n.tweenRunning)return;a("on",s)}}})},q=function(){function e(e){function o(t,e){a.type=r.keyboard.scrollType,a.scrollAmount=r.keyboard.scrollAmount,"stepped"===a.type&&i.tweenRunning||N(n,t,e)}switch(e.type){case"blur":i.tweenRunning&&a.dir&&o("off",null);break;case"keydown":case"keyup":var s=e.keyCode?e.keyCode:e.which,l="on";if("x"!==r.axis&&(38===s||40===s)||"y"!==r.axis&&(37===s||39===s)){if((38===s||40===s)&&!i.overflowed[0]||(37===s||39===s)&&!i.overflowed[1])return;"keyup"===e.type&&(l="off"),t(document.activeElement).is(p)||(e.preventDefault(),e.stopImmediatePropagation(),o(l,s))}else if(33===s||34===s){if((i.overflowed[0]||i.overflowed[1])&&(e.preventDefault(),e.stopImmediatePropagation()),"keyup"===e.type){Y(n);var d=34===s?-1:1;if("x"===r.axis||"yx"===r.axis&&i.overflowed[1]&&!i.overflowed[0])var h="x",f=Math.abs(c[0].offsetLeft)-d*(.9*u.width());else var h="y",f=Math.abs(c[0].offsetTop)-d*(.9*u.height());X(n,f.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}else if((35===s||36===s)&&!t(document.activeElement).is(p)&&((i.overflowed[0]||i.overflowed[1])&&(e.preventDefault(),e.stopImmediatePropagation()),"keyup"===e.type)){if("x"===r.axis||"yx"===r.axis&&i.overflowed[1]&&!i.overflowed[0])var h="x",f=35===s?Math.abs(u.width()-c.outerWidth(!1)):0;else var h="y",f=35===s?Math.abs(u.height()-c.outerHeight(!1)):0;X(n,f.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}}var n=t(this),i=n.data(o),r=i.opt,a=i.sequential,s=o+"_"+i.idx,l=t("#mCSB_"+i.idx),c=t("#mCSB_"+i.idx+"_container"),u=c.parent(),p="input,textarea,select,datalist,keygen,[contenteditable='true']",d=c.find("iframe"),h=["blur."+s+" keydown."+s+" keyup."+s];d.length&&d.each(function(){t(this).load(function(){L(this)&&t(this.contentDocument||this.contentWindow.document).bind(h[0],function(t){e(t)})})}),l.attr("tabindex","0").bind(h[0],function(t){e(t)})},N=function(e,n,i,r,a){function s(t){p.snapAmount&&(d.scrollAmount=p.snapAmount instanceof Array?"x"===d.dir[0]?p.snapAmount[1]:p.snapAmount[0]:p.snapAmount);var n="stepped"!==d.type,o=a?a:t?n?m/1.5:g:1e3/60,i=t?n?7.5:40:2.5,l=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)],u=[c.scrollRatio.y>10?10:c.scrollRatio.y,c.scrollRatio.x>10?10:c.scrollRatio.x],f="x"===d.dir[0]?l[1]+d.dir[1]*(u[1]*i):l[0]+d.dir[1]*(u[0]*i),v="x"===d.dir[0]?l[1]+d.dir[1]*parseInt(d.scrollAmount):l[0]+d.dir[1]*parseInt(d.scrollAmount),y="auto"!==d.scrollAmount?v:f,b=r?r:t?n?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",_=!!t;return t&&o<17&&(y="x"===d.dir[0]?l[1]:l[0]),X(e,y.toString(),{dir:d.dir[0],scrollEasing:b,dur:o,onComplete:_}),t?void(d.dir=!1):(clearTimeout(d.step),void(d.step=setTimeout(function(){s()},o)))}function l(){clearTimeout(d.step),G(d,"step"),Y(e)}var c=e.data(o),p=c.opt,d=c.sequential,h=t("#mCSB_"+c.idx+"_container"),f="stepped"===d.type,m=p.scrollInertia<26?26:p.scrollInertia,g=p.scrollInertia<1?17:p.scrollInertia;switch(n){case"on":if(d.dir=[i===u[16]||i===u[15]||39===i||37===i?"x":"y",i===u[13]||i===u[15]||38===i||37===i?-1:1],Y(e),tt(i)&&"stepped"===d.type)return;s(f);break;case"off":l(),(f||c.tweenRunning&&d.dir)&&s(!0)}},U=function(e){var n=t(this).data(o).opt,i=[];return"function"==typeof e&&(e=e()),e instanceof Array?i=e.length>1?[e[0],e[1]]:"x"===n.axis?[null,e[0]]:[e[0],null]:(i[0]=e.y?e.y:e.x||"x"===n.axis?null:e,i[1]=e.x?e.x:e.y||"y"===n.axis?null:e),"function"==typeof i[0]&&(i[0]=i[0]()),"function"==typeof i[1]&&(i[1]=i[1]()),i},z=function(e,n){if(null!=e&&"undefined"!=typeof e){var i=t(this),r=i.data(o),a=r.opt,s=t("#mCSB_"+r.idx+"_container"),l=s.parent(),c=typeof e;n||(n="x"===a.axis?"x":"y");var u="x"===n?s.outerWidth(!1):s.outerHeight(!1),d="x"===n?s[0].offsetLeft:s[0].offsetTop,h="x"===n?"left":"top";switch(c){case"function":return e();case"object":var f=e.jquery?e:t(e);if(!f.length)return;return"x"===n?et(f)[1]:et(f)[0];case"string":case"number":if(tt(e))return Math.abs(e);if(e.indexOf("%")!==-1)return Math.abs(u*parseInt(e)/100);if(e.indexOf("-=")!==-1)return Math.abs(d-parseInt(e.split("-=")[1]));if(e.indexOf("+=")!==-1){var m=d+parseInt(e.split("+=")[1]);return m>=0?0:Math.abs(m)}if(e.indexOf("px")!==-1&&tt(e.split("px")[0]))return Math.abs(e.split("px")[0]);if("top"===e||"left"===e)return 0;if("bottom"===e)return Math.abs(l.height()-s.outerHeight(!1));if("right"===e)return Math.abs(l.width()-s.outerWidth(!1));if("first"===e||"last"===e){var f=s.find(":"+e);return"x"===n?et(f)[1]:et(f)[0]}return t(e).length?"x"===n?et(t(e))[1]:et(t(e))[0]:(s.css(h,e),void p.update.call(null,i[0]))}}},H=function(e){function n(){return clearTimeout(d[0].autoUpdate),0===s.parents("html").length?void(s=null):void(d[0].autoUpdate=setTimeout(function(){return c.advanced.updateOnSelectorChange&&(l.poll.change.n=r(),l.poll.change.n!==l.poll.change.o)?(l.poll.change.o=l.poll.change.n,void a(3)):c.advanced.updateOnContentResize&&(l.poll.size.n=s[0].scrollHeight+s[0].scrollWidth+d[0].offsetHeight+s[0].offsetHeight+s[0].offsetWidth,l.poll.size.n!==l.poll.size.o)?(l.poll.size.o=l.poll.size.n,void a(1)):!c.advanced.updateOnImageLoad||"auto"===c.advanced.updateOnImageLoad&&"y"===c.axis||(l.poll.img.n=d.find("img").length,l.poll.img.n===l.poll.img.o)?void((c.advanced.updateOnSelectorChange||c.advanced.updateOnContentResize||c.advanced.updateOnImageLoad)&&n()):(l.poll.img.o=l.poll.img.n,void d.find("img").each(function(){i(this)}))},c.advanced.autoUpdateTimeout))}function i(e){function n(t,e){return function(){return e.apply(t,arguments)}}function o(){this.onload=null,t(e).addClass(u[2]),a(2)}if(t(e).hasClass(u[2]))return void a();var i=new Image;i.onload=n(i,o),i.src=e.src}function r(){c.advanced.updateOnSelectorChange===!0&&(c.advanced.updateOnSelectorChange="*");var t=0,e=d.find(c.advanced.updateOnSelectorChange);return c.advanced.updateOnSelectorChange&&e.length>0&&e.each(function(){t+=this.offsetHeight+this.offsetWidth}),t}function a(t){clearTimeout(d[0].autoUpdate),p.update.call(null,s[0],t)}var s=t(this),l=s.data(o),c=l.opt,d=t("#mCSB_"+l.idx+"_container");return e?(clearTimeout(d[0].autoUpdate),void G(d[0],"autoUpdate")):void n()},W=function(t,e,n){return Math.round(t/e)*e-n},Y=function(e){var n=e.data(o),i=t("#mCSB_"+n.idx+"_container,#mCSB_"+n.idx+"_container_wrapper,#mCSB_"+n.idx+"_dragger_vertical,#mCSB_"+n.idx+"_dragger_horizontal");i.each(function(){V.call(this)})},X=function(e,n,i){function r(t){return l&&c.callbacks[t]&&"function"==typeof c.callbacks[t]}function a(){return[c.callbacks.alwaysTriggerOffsets||_>=w[0]+D,c.callbacks.alwaysTriggerOffsets||_<=-C]}function s(){var t=[h[0].offsetTop,h[0].offsetLeft],n=[y[0].offsetTop,y[0].offsetLeft],o=[h.outerHeight(!1),h.outerWidth(!1)],r=[d.height(),d.width()];e[0].mcs={content:h,top:t[0],left:t[1],draggerTop:n[0],draggerLeft:n[1],topPct:Math.round(100*Math.abs(t[0])/(Math.abs(o[0])-r[0])),leftPct:Math.round(100*Math.abs(t[1])/(Math.abs(o[1])-r[1])),direction:i.dir}}var l=e.data(o),c=l.opt,u={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},i=t.extend(u,i),p=[i.dur,i.drag?0:i.dur],d=t("#mCSB_"+l.idx),h=t("#mCSB_"+l.idx+"_container"),f=h.parent(),m=c.callbacks.onTotalScrollOffset?U.call(e,c.callbacks.onTotalScrollOffset):[0,0],g=c.callbacks.onTotalScrollBackOffset?U.call(e,c.callbacks.onTotalScrollBackOffset):[0,0];if(l.trigger=i.trigger,0===f.scrollTop()&&0===f.scrollLeft()||(t(".mCSB_"+l.idx+"_scrollbar").css("visibility","visible"),f.scrollTop(0).scrollLeft(0)),"_resetY"!==n||l.contentReset.y||(r("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(e[0]),l.contentReset.y=1),"_resetX"!==n||l.contentReset.x||(r("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(e[0]),l.contentReset.x=1),"_resetY"!==n&&"_resetX"!==n){if(!l.contentReset.y&&e[0].mcs||!l.overflowed[0]||(r("onOverflowY")&&c.callbacks.onOverflowY.call(e[0]),l.contentReset.x=null),!l.contentReset.x&&e[0].mcs||!l.overflowed[1]||(r("onOverflowX")&&c.callbacks.onOverflowX.call(e[0]),l.contentReset.x=null),c.snapAmount){var v=c.snapAmount instanceof Array?"x"===i.dir?c.snapAmount[1]:c.snapAmount[0]:c.snapAmount;n=W(n,v,c.snapOffset)}switch(i.dir){case"x":var y=t("#mCSB_"+l.idx+"_dragger_horizontal"),b="left",_=h[0].offsetLeft,w=[d.width()-h.outerWidth(!1),y.parent().width()-y.width()],k=[n,0===n?0:n/l.scrollRatio.x],D=m[1],C=g[1],S=D>0?D/l.scrollRatio.x:0,$=C>0?C/l.scrollRatio.x:0;break;case"y":var y=t("#mCSB_"+l.idx+"_dragger_vertical"),b="top",_=h[0].offsetTop,w=[d.height()-h.outerHeight(!1),y.parent().height()-y.height()],k=[n,0===n?0:n/l.scrollRatio.y],D=m[0],C=g[0],S=D>0?D/l.scrollRatio.y:0,$=C>0?C/l.scrollRatio.y:0}k[1]<0||0===k[0]&&0===k[1]?k=[0,0]:k[1]>=w[1]?k=[w[0],w[1]]:k[0]=-k[0],e[0].mcs||(s(),r("onInit")&&c.callbacks.onInit.call(e[0])),clearTimeout(h[0].onCompleteTimeout),J(y[0],b,Math.round(k[1]),p[1],i.scrollEasing),!l.tweenRunning&&(0===_&&k[0]>=0||_===w[0]&&k[0]<=w[0])||J(h[0],b,Math.round(k[0]),p[0],i.scrollEasing,i.overwrite,{onStart:function(){i.callbacks&&i.onStart&&!l.tweenRunning&&(r("onScrollStart")&&(s(),c.callbacks.onScrollStart.call(e[0])),l.tweenRunning=!0,x(y),l.cbOffsets=a())},onUpdate:function(){i.callbacks&&i.onUpdate&&r("whileScrolling")&&(s(),c.callbacks.whileScrolling.call(e[0]))},onComplete:function(){if(i.callbacks&&i.onComplete){"yx"===c.axis&&clearTimeout(h[0].onCompleteTimeout);var t=h[0].idleTimer||0;h[0].onCompleteTimeout=setTimeout(function(){r("onScroll")&&(s(),c.callbacks.onScroll.call(e[0])),r("onTotalScroll")&&k[1]>=w[1]-S&&l.cbOffsets[0]&&(s(),c.callbacks.onTotalScroll.call(e[0])),r("onTotalScrollBack")&&k[1]<=$&&l.cbOffsets[1]&&(s(),c.callbacks.onTotalScrollBack.call(e[0])),l.tweenRunning=!1,h[0].idleTimer=0,x(y,"hide")},t)}}})}},J=function(t,e,n,o,i,r,a){function s(){w.stop||(y||f.call(),y=K()-v,l(),y>=w.time&&(w.time=y>w.time?y+d-(y-w.time):y+d-1,w.time0?(w.currVal=p(w.time,b,k,o,i),_[e]=Math.round(w.currVal)+"px"):_[e]=n+"px",m.call()}function c(){d=1e3/60,w.time=y+d,h=window.requestAnimationFrame?window.requestAnimationFrame:function(t){return l(),setTimeout(t,.01)},w.id=h(s)}function u(){null!=w.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(w.id):clearTimeout(w.id),w.id=null)}function p(t,e,n,o,i){switch(i){case"linear":case"mcsLinear":return n*t/o+e;case"mcsLinearOut":return t/=o,t--,n*Math.sqrt(1-t*t)+e;case"easeInOutSmooth":return t/=o/2,t<1?n/2*t*t+e:(t--,-n/2*(t*(t-2)-1)+e);case"easeInOutStrong":return t/=o/2,t<1?n/2*Math.pow(2,10*(t-1))+e:(t--,n/2*(-Math.pow(2,-10*t)+2)+e);case"easeInOut":case"mcsEaseInOut":return t/=o/2,t<1?n/2*t*t*t+e:(t-=2,n/2*(t*t*t+2)+e);case"easeOutSmooth":return t/=o,t--,-n*(t*t*t*t-1)+e;case"easeOutStrong":return n*(-Math.pow(2,-10*t/o)+1)+e;case"easeOut":case"mcsEaseOut":default:var r=(t/=o)*t,a=r*t;return e+n*(.499999999999997*a*r+-2.5*r*r+5.5*a+-6.5*r+4*t)}}t._mTween||(t._mTween={top:{},left:{}});var d,h,a=a||{},f=a.onStart||function(){},m=a.onUpdate||function(){},g=a.onComplete||function(){},v=K(),y=0,b=t.offsetTop,_=t.style,w=t._mTween[e];"left"===e&&(b=t.offsetLeft);var k=n-b;w.stop=0,"none"!==r&&u(),c()},K=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},V=function(){var t=this;t._mTween||(t._mTween={top:{},left:{}});for(var e=["top","left"],n=0;n=0&&o[0]+et(i)[0]=0&&o[1]+et(i)[1]")!==-1||o.responseText.indexOf("
    exception ")!==-1)console.log("后端返回错误信息=> ",o.responseText),"localhost"===location.hostname&&t({title:"警告:前方高能!",$content:o.responseText,hideClose:!0,modalSize:"modal-lg"});else if(o.responseJSON&&1===o.responseJSON.status){if(p=o.responseJSON,!p.data)return;var d=p.data[0];if(i.url.indexOf("/user/stat")===-1&&"login"===d)require("main").register();else if("form"===d&&p.data[1].hasOwnProperty("captcha")&&1===_.keys(p.data[1]).length)captchaPostData.api=i.url,captchaPostData.data=i.data,t({modalSize:"modal-sm",title:p.data[1].captcha,content:"
    ",hideClose:!0,doneText:"确认并提交",doneFn:function(){var t;return t=$("#captchaPostForm").find("input[name=captcha]"),captchaPostData.captcha=t.val(),$.post("/api/captcha/check",{captcha:captchaPostData.captcha},function(e){if(!e.status)return e.data?$.post(captchaPostData.api,captchaPostData.data+"&captcha="+captchaPostData.captcha,function(t){return window.captchaPostData={},t.data.hasOwnProperty("url")?location.href=t.data.url:location.reload()}):(t.addClass("error"),console.log("验证码错误"),$(".reloadCaptcha").trigger("click"))})}});else if("robot"===d)location.href="/stop-robot";else if("unactivated"===d)t("hide"),$("#activate").modal("show");else if("nonBlocked"===d)t(p.data[1]);else if("access"===d)t({title:p.data[1][0],content:p.data[1][1],hideClose:!0});else if("form"===d){var h=i.url.split("?")[0];u=i.url.split("/")[2],u=u.split("?")[0],l=new RegExp("[?&]_="+n._),c=i.url.replace(l,""),r=!0;var f=p.data[1];$.each(f,function(t,e){var n,o,i,a;if("captcha"===t&&($("[name=captcha]").parents(".form-group").show(),$(".captcha").parent("a").click()),i=t.toLowerCase().replace(/\b[a-z]/g,function(t){return t.toUpperCase()}),"tags"===t&&"必须填写标签"===e)return void $("#article .sf-typeHelper, #question .sf-typeHelper , #live .sf-typeHelper, #liveSeries .sf-typeHelper, .blog-post .sf-typeHelper, .sf-typeHelper--fortags").addClass("error").after(''+e+"");if("cap"===t)return $('input[name="cap"]').closest(".form-group").find(".help-block.err").remove(),$(".captchaInput").addClass("has-error"),$('input[name="cap"]').closest(".form-group").addClass("has-error"),void $('input[name="cap"]').addClass("error").after(''+e+"");if("list"===t)return void $("#liveSeries .liveseries-select").addClass("error").after(''+e+"");if(a="#"+u+i,0===$(a).length&&(a="#"+u.replace(/s$/,"")+i),o=$("form#"+u+" *[name="+t+"]").not("[type=hidden]").parents(".form-group"),0===o.length&&(o=$("form#"+u.replace(/s$/,"")+" *[name="+t+"]").not("[type=hidden]").parents(".form-group")),n=$('form[action="'+h+'"] *[name='+t+"]").not("[type=hidden]").parents(".form-group"),n.length||(n=$('form[action="'+c+'"] *[name='+t+"]").not("[type=hidden]").parents(".form-group"),n.length||(n=$('.form[action="'+h+'"] *[name='+t+"]").not("[type=hidden]").parents(".form-group"),n.length||(n=$("form *[name="+t+"]").not("[type=hidden]").parents(".form-group"),n.length||(n=$("form *[data-name="+t+"]").not("[type=hidden]").parents(".form-group"))))),$(a).length)$(a).addClass("error").attr("data-error",e),0===$(a).next(".error--msg").length&&$(a).after(''+e+"");else if(o.length){o.find(".help-block.err").remove(),o.addClass("has-error");var s=o.find("[name="+t+"]").not("[type=hidden]"),l=s.closest(".input-group");l.length>0?l.after(''+e+""):s.after(''+e+"")}else if(n.length)n.find(".help-block").remove(),n.addClass("has-error"),n.find(".input-group").length>0?n.find(".input-group").after(''+e+""):(n.find("[name="+t+"]").not("[type=hidden]").parents(".form-group").append(''+e+""),n.find("[data-name="+t+"]").not("[type=hidden]").parents(".form-group").append(''+e+""));else if($("form").length&&!$("form").hasClass("header-search")){if($("form#"+u+" *[name="+t+"]").not("[type=hidden]").siblings(".error--msg").remove(),$("form#"+u+" *[name="+t+"]").not("[type=hidden]").addClass("error").attr("data-error",e).after(''+e+""),1===$("form").length&&$("form").hasClass("header-search")){var p=$(".form *[data-name="+t+"]");0==p.length&&(p=$(".form *[name="+t+"]"));var d=p.closest(".form-group");d.addClass("has-error"),d.find(".err").remove(),p.after(''+e+"")}}else if($(".form").length){var f=$(".form *[data-name="+t+"]");0==f.length&&(f=$(".form *[name="+t+"]"));var m=f.closest(".form-group");m.hasClass("err-inline")?(m.addClass("has-error"),m.find(".err").remove(),f.after(''+e+"")):(m.addClass("has-error"),m.find(".err").remove(),f.after(''+e+""))}r&&($(a).length?$(a).focus():(n.length&&n.find("[name="+t+"]").not("[type=hidden]").focus(),o.length&&o.find("[name="+t+"]").not("[type=hidden]").focus(),r=!1))})}else a=["limit","lock","author","rank","account"],_.find(a,function(t){return t===d})?$.get("/api/errorMessage",{type:d,key:p.data[1]},function(e){if(e.data)return t({title:e.data[0],content:e.data[1],hideClose:!0})}):t({title:d,content:p.data[1],hideClose:!0})}})}),define("header",["main","sfModal","isMobile","underscore"],function(t,e,n,o){$(".opts__item.user").first().on("touchend",function(t){n("any")&&$(this).find(".dropdown-avatar-menu").toggle()}),$(".dropdown-avatar-menu").first().on("touchend",function(t){n("any")&&t.stopPropagation()}),$(".3rdLogin").click(function(t){t.preventDefault(),window.open($(this).attr("href"),"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500")}),$(".menu__item--more a").first().on("click",function(t){t.preventDefault()});var i='\n
    \n ',r=function(){return $.get("/api/activity/recommend",function(t){if(0==t.status){var e=o.template(i)(t);$(".dropdown-block").append(e),$(".dropdown-content-menu").css("height")<$(".dropdown-content-recommend").css("height")&&$(".dropdown-content-menu").css("height",$(".dropdown-content-recommend").css("height")),t.data.length||$(".dropdown-content-recommend").addClass("hidden")}}),(r=function(){})()};$(".menu__item--more").hoverIntent(function(){$(this).find(".dropdown-block").removeClass("hidden"),r()},function(){$(this).find(".dropdown-block").addClass("hidden")},null,1),$(".hoverDropdown").hoverIntent(function(){$(this).find(".dropdown-avatar-menu").removeClass("hidden")},function(){$(this).find(".dropdown-avatar-menu").addClass("hidden")},null,1),$(".dropdownBtn").click(function(t){var e;$(this).parent(".hoverDropdown").hasClass("open")&&(t.preventDefault(),e=$(this).attr("href"),t.ctrlKey||t.metaKey?window.open(e):location.href=e)}),$("#shouldGoTo").on("click",function(t){var e=$(this),n=e.data("type");$("body").hasClass("news-list");switch(n){case"blog":location.href="/write";break;case"qa":$(".site-ask-btn").length>0?location.href=$(".site-ask-btn").attr("href"):location.href="/ask";break;case"news":location.href="/submit";break;case"note":location.href="/record";break;default:$("body").hasClass("user-note")?location.href="/record":location.href="/ask"}}),$(".header-search input").on("focus",function(t){t.preventDefault(),$(".sf-header").addClass("search-open")}),$(".header-search input").on("blur",function(t){t.preventDefault(),$(".sf-header").removeClass("search-open")}),function(){var t=["/lives","/news"];t.forEach(function(t){!function(t){var e="navItemHighlight"+t,n=$('.sf-header--index [href="'+t+'"]');$(".header-response").length||(localStorage.getItem(e)||n.addClass("menu__item--new-show"),n.on("click",function(){localStorage.getItem(e)||localStorage.setItem(e,1)}))}(t)})}(),$("#live__nav--newest").on("click",function(t){var e=$(this);ddosMode?e.removeClass("livemenu__item--new-show"):socket.emit("check_live",function(){e.removeClass("livemenu__item--new-show")})}),$('.sf-header--index [href="/lives"]').on("click",function(t){var e=$(this);ddosMode?e.removeClass("menu__item--new-show"):socket.emit("check_live",function(){e.removeClass("menu__item--new-show")})})}),jQuery(function(t){t(document).ready(function(){var e=[],n=[],o=0,i="",r="",a="",s=null,l=0,c=0,u=0,p=0,d=0;t(window).scroll(function(e){var n=t(this).scrollTop();i=n>o?"down":"up",o=n}),t.fn.stickUp=function(e){t(this).addClass("stuckMenu");var o=0;if(null!=e){for(var i in e.parts)e.parts.hasOwnProperty(i)&&(n[o]=e.parts[o],o++);0==o&&console.log("error:needs arguments"),r=e.itemClass,a=e.itemHover,null!=e.topMargin?"auto"==e.topMargin?p=parseInt(t(".stuckMenu").css("margin-top")):isNaN(e.topMargin)&&e.topMargin.search("px")>0?p=parseInt(e.topMargin.replace("px","")):isNaN(parseInt(e.topMargin))?(console.log("incorrect argument, ignored."),p=0):p=parseInt(e.topMargin):p=0,s=t("."+r).size()}l=parseInt(t(this).height()),c=parseInt(t(this).css("margin-bottom")),u=parseInt(t(this).next().closest("div").css("margin-top")),d=t(this).offset()?parseInt(t(this).offset().top):null},t(document).on("scroll",function(){function o(o){contentView=.4*t("#"+n[o]).height(),testView=e[o]-contentView,varscroll>testView?(t("."+r).removeClass(a),t("."+r+":eq("+o+")").addClass(a)):varscroll<50&&(t("."+r).removeClass(a),t("."+r+":eq(0)").addClass(a))}if(varscroll=parseInt(t(document).scrollTop()),null!=s)for(var h=0;he[h]-50&&varscroll0&&d<=varscroll+p+10&&t("#footer").offset().top>varscroll+t(".ad-should-be-fixed").height()+66&&(t(".stuckMenu").addClass("isStuck"),t(".stuckMenu").next().closest("div").css({"margin-top":l+c+u+"px"},10),t(".stuckMenu").css("position","fixed"),t(".isStuck").css({top:"10px"},10,function(){})),varscroll+p+10

    关注微信号

    ',html:!0,placement:"top",trigger:"hover"}),t(".weixin-popover-qrcode").mouseover(function(e){t(this).popover("show")}),function(){d=function(){t(".opts__item--message").removeClass("hide"),t.get("/api/notifications",function(e){var n,o,i,r;e.status||(e.data=null!=(o=e.data)?o:[],i={data:e.data,unread:{general:_.filter(e.data.general,function(t){return 0===parseInt(t.viewed)}).length,ranked:_.filter(e.data.ranked,function(t){return 0===parseInt(t.viewed)}).length,followed:_.filter(e.data.followed,function(t){return 0===parseInt(t.viewed)}).length,comment:_.filter(e.data.comment,function(t){return 0===parseInt(t.viewed)}).length}},r=_.reduce(i.unread,function(t,e){return t+e},0),r>0&&t(".opts__item--message .message-ingore-all").removeClass("hide"),t("#messageGeneral").html(_.template(t("#messageGeneralTpl").html())(i.data)),t("#messageComment").html(_.template(t("#messageCommentTpl").html())(i.data)),t("#messageRanked").html(_.template(t("#messageRankedTpl").html())(i.data)),t("#messageFollowed").html(_.template(t("#messageFollowedTpl").html())(i.data)),t(".opts__item--message-loading").remove(),n={},t(".mCustomScrollbar-message").mCustomScrollbar({scrollInertia:0,callbacks:{onScroll:function(){var e,o,i;if(i=this.mcs.topPct,o=t(this).data("proto"),n[o]=n[o]||2,i>55&&n[o]!==-1){if(console.log(o,i,"ajax page "+n[o]),e="/api/notifications?type="+o+"&page="+n[o],window.__api===e)return;return window.__api=e,t.get(e,function(e){var i,r;if(!e.status)return i=e.data[o],i.length>0?(r=_.template(t("#item--"+o).html())(e.data),t(".tab-pane.active .mCSB_container").append(r),n[o]++):n[o]=-1})}}}}))})},t(".opts__item--message .message-ingore-all").on("click",function(){var e;e=t(this),t.post("/api/notifications/all/view",function(n){return d(),t(".notice-dot").addClass("hide"),e.addClass("hide")})}),t(".opts__item--message").on("click",".message__btn--follow",function(){var e,n;return e=t(this),n=e.data("id"),e.addClass("disabled"),t.post("/api/user/"+n+"/follow",function(t){return d(),e.removeClass("disabled")})}),t(".opts__item--message").on("click",".message__btn--unfollow",function(){var e,n;return e=t(this),n=e.data("id"),e.addClass("disabled"),t.post("/api/user/"+n+"/follow/cancel",function(t){return d(),e.removeClass("disabled")})}),t(".dropdown-toggle-message").on("click",function(e){var n;return e.preventDefault(),n=t(".opts__item--message"),"undefined"!=typeof v&&v.emit("read"),r.titleRender.clear("message"),r.titleRender.clear("event"),"none"!==n.css("display")?n.addClass("hide"):(d(),t.get("/api/notifications/viewed",function(e){var n;if(n=null,!e.status)return _.each(e.data,function(e,o){if(e)return n?(n=t(".notice-dot-"+o),n.removeClass("hide"),n.removeClass("notice-dot--special")):(n=t(".notice-dot-"+o),n.addClass("notice-dot--special"),n.closest("a[role='tab']").trigger("click"))})}))}),t(".opts__item--message a[role='tab']").on("click",function(e){var n;if(t(".opts__item--message .active").not(".btn").removeClass("active"),t(this).addClass("active"),t(this).find(".notice-dot.hide").length>0&&0===t(this).find(".notice-dot--special").length);else if(t(this).find(".notice-dot").addClass("hide"),n=t(this).attr("href"),"#messageRanked"===n&&t.post("/api/notifications/viewed?type=ranked"),"#messageComment"===n&&t.post("/api/notifications/viewed?type=comment"),"#messageGeneral"===n&&t.post("/api/notifications/viewed?type=general"),"#messageInbox"===n&&t.post("/api/notifications/viewed?type=inbox"),"#messageFollowed"===n)return t.post("/api/notifications/viewed?type=followed")}),t("body").on("click",function(e){"none"!==t(".opts__item--message").css("display")&&0===t(e.target).parents(".message").length&&t(".opts__item--message").addClass("hide")})}(),function(){var e=function(){t(".opts__item--letter").removeClass("hide"),t.get("/api/messages",function(e){if(!e.status){t("#messageInbox").html(_.template(t("#messageInboxTpl").html())({inboxes:e.data})),t(".opts__item--letter-loading").remove();var n=_.filter(e.data,function(t){return 0===parseInt(t.viewed)}).length;n>0&&t(".opts__item--letter .message-ingore-all").removeClass("hide")}})};t("#messageInbox").on("click","li",function(){var e,n;if(e=t(this),n=e.data("click"),Boolean(n))return location.href=n}),t(".opts__item--letter .message-ingore-all").on("click",function(){var n;n=t(this),t.post("/api/messages/all/view",function(t){e(),n.addClass("hide")})}),t(".dropdown-toggle-letter").on("click",function(n){n.preventDefault();var o=t(".opts__item--letter");"none"!==o.css("display")?o.addClass("hide"):e()}),t("body").on("click",function(e){"none"!==t(".opts__item--letter").css("display")&&0===t(e.target).parents(".letter").length&&t(".opts__item--letter").addClass("hide")}),t("#settings-btn").click(function(){t(".opts__item--letter").toggleClass("hide")})}(),"/tags"===t(".nav__item--more>a").attr("href")||(t("body").on("click",function(e){if("none"!==t(".tag-mgr__box").css("display")&&0===t(e.target).closest(".nav__item--more").length&&0===t(e.target).closest(".tag-mgr__box").length)return t(".nav__item--more").trigger("click")}),t(".tag-mgr__query").on("keyup",function(e){var n,o,i,r;return n=t(this), r=n.data("tags"),o=t(this).val(),i=function(e){var n,i,a;if(a='
  • <%= name %>
  • ',n=_.filter(r,function(t){return t.name.search(e)!==-1}),i=_.reduce(n,function(t,e){return t+_.template(a)(e)},""),t(".tag-mgr__list").html(i),t(".tag-mgr__list li").length>0&&o.length>0)return t(".tag-mgr__list li:first-child").addClass("active")},m.inputT&&clearTimeout(m.inputT),m.inputT=setTimeout(function(){return i(o)},100)}),t(".tag-mgr__list").on("mouseover",function(){if(t(".tag-mgr__list li").length>1)return t(".tag-mgr__list li.active").removeClass("active")}),m={inputT:0,t:0},t(".nav__item--more").on("click",function(){var e,n,o;return n=t(this),e=t(".tag-mgr__box"),o=Number(n.data("open")),o?e.addClass("hide"):(e.removeClass("hide"),t(".tag-mgr__query").focus()),t(this).data("open",Number(!o))})),t(".js__action--complain").on("click",function(){return e({title:"我要申诉",content:_.template(t("#js__action--complain-tpl").html()),doneFn:function(){return t(".complain__form").submit()}})}),t(".js__view--selector").on("click",function(){var e;return e=t(this).data("action"),t.cookie("view",e),location.reload()}),t.cookie("view")&&t(".js__view--selector").removeClass("hidden-sm").removeClass("hidden-md").removeClass("hidden-lg"),s=function(){var t,e,n;n="test",e=window.sessionStorage;try{return e.setItem(n,"1"),e.removeItem(n),!0}catch(e){return t=e,!1}},g=function(e){var n;s()&&(e>500||(localStorage&&(n=localStorage.getItem("show-app-promotion-bar"),n=n||!0,n!==!0?t(".app-promotion-bar").hide():t(".app-promotion-bar").show()),t("body").on("click",".close",function(){t(".app-promotion-bar").hide(),localStorage.setItem("show-app-promotion-bar",!1)}),t("body").on("click",".icon",function(){t(".app-promotion-bar").hide(),localStorage.setItem("show-app-promotion-bar",!1)})))},a=function(t){var e,n;switch(n="",e=new Date(t),e.getDay()){case 0:n="周日";break;case 1:n="周一";break;case 2:n="周二";break;case 3:n="周三";break;case 4:n="周四";break;case 5:n="周五";break;case 6:n="周六"}return n},l=function(){e({title:"登录",doneText:"登录",hideClose:!0,hideDone:!0,hideFooter:!0,content:t("#loginModal").text(),show:function(){return t("input[name=username]").focus(),window.ga&&ga("send","event","login modal","show","login modal"),t("[name=mail]").first().focus(),t("#loginShowMore").click(function(e){e.preventDefault(),t(this).hide(),t(this).siblings().removeClass("hidden")}),t(".sfmodal .widget-login a").click(function(e){e.preventDefault(),window.open(t(this).attr("href"),"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500")}),t("#loginReloadCaptcha").click(function(){t(this).find("img").attr("src","/user/captcha?w=145&h=34")})}}),t(".register-mail").typeHelperOld({emailMode:!0,onlyResult:!1})},c=function(){e({title:"注册",doneText:"登录",hideClose:!0,hideDone:!0,hideFooter:!0,content:t("#registerModal").text(),show:function(){return setTimeout(function(){t("input[name=name]").focus()},0),window.ga&&ga("send","event","login modal","show","login modal"),t("[name=mail]").first().focus(),t("#loginShowMore").click(function(e){e.preventDefault(),t(this).hide(),t(this).siblings().removeClass("hidden")}),t(".sfmodal .widget-login a").click(function(e){e.preventDefault(),window.open(t(this).attr("href"),"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500")}),t("#login-name").on("input",function(e){var n=/^[0-9]{11}$/;n.test(e.target.value.trim())?(t(".phone-register-only").removeClass("hidden"),t(this).closest("form").attr("action","/api/user/phone/register"),t("[name=register_type]").val("phone"),t("#login-name").attr("name","phone")):(t(".phone-register-only").addClass("hidden"),t(this).closest("form").attr("action","/api/user/register"),t("[name=register_type]").val("mail"),t("#login-name").attr("name","mail"))}),t("#loginReloadCaptcha").click(function(){t(this).find("img").attr("src","/user/captcha?w=145&h=34")})}}),t(".register-mail").typeHelperOld({emailMode:!0,onlyResult:!1})},u=function(){e({modalSize:"modal-md",title:"绑定手机号",doneText:"绑定手机号",hideClose:!0,hideDone:!0,hideFooter:!0,content:t("#bindPhoneModal").text(),doneFn:function(){var e=t(".form__bindphone-apply").serializeArray(),n={};e.map(function(t){n[t.name]=t.value}),t.post("/api/user/phone/bind/check",n,function(e){if(e.status){var n=e.data[1];n.phone&&t("phone").parents(".form-group").addClass("has-error").find(".help-block").html(n.phone)}else alert("绑定成功"),location.reload()})}})},p=function(){e({modalSize:"modal-md",title:"手机验证码登陆",doneText:"绑定",content:t("#phoneLoginModal").text(),doneFn:function(){var e=t(".form__bindphone-apply").serializeArray(),n={};e.map(function(t){n[t.name]=t.value}),t.post("/api/user/phone/bind/check",n,function(t){t.status||(alert("绑定成功"),location.reload())})}})},f=function(){this.title=t("title"),this.titleText=this.title.html(),this.map={}},f.prototype._render=function(){count=0;for(k in this.map)count+=parseInt(this.map[k]);this.title.html((count>0?"("+(count>=100?"...":count)+") ":"")+this.titleText)},f.prototype.set=function(t,e){this.map[t]=e,this._render()},f.prototype.clear=function(t){delete this.map[t],this._render()},t(".addWeek").each(function(e,n){t(this).append(" "+a(t(this).html()))}),t('[data-toggle="tooltip"]').tooltip({container:"body"}),t("img.lazy").lazyload({effect:"fadeIn"}),window.oauthLogin=function(t){location.hostname.indexOf("segmentfault")!==-1?location.reload():location.href="/"},window.oauthRegister=function(t){location.href="/user/bind"},r={_:window.SF.token,staticUrl:window.SF.staticUrl,userId:t("#SFUserId").attr("value"),userRank:t("#SFUserRank").attr("value"),login:n.login||l,register:c,bindphone:u,phonelogin:p,titleRender:new f},t(document).ajaxError(function(e,n,o){413===n.status?(t("#uploading")&&t("#uploading").text(""),alert("文件大小或尺寸超出限制,请修改后重新上传!")):console.log("Ajax "+n.status+": ",o.url)}),t(document).ajaxSend(function(t,e,n){n.url.indexOf("?")===-1?n.url=n.url+"?_="+r._:n.url=n.url+"&_="+r._}),t("body").delegate("form","submit",function(e){var n;n=t(this),n.attr("method")&&n.attr("action")&&(e.preventDefault(),n.find("button[type=submit]").attr("disabled","disabled"),t.ajax({url:n.attr("action"),type:n.attr("method"),data:n.serialize(),success:function(t){n.find("button[type=submit]").removeAttr("disabled"),0===t.status&&("/api/user?do=login"===n.attr("action")&&"/user/login"!==location.pathname?window.location.reload():/^\//.test(t.data)?window.location=t.data:window.location.reload())}}))}),t("body").delegate("form input, form textarea, .form input, .form textarea","keydown",function(e){t(this).removeClass("error"),t(this).parents(".form-group").removeClass("has-error"),t(this).next(".help-block.err").remove(),t(this).next(".error--msg").remove(),t(this).parents(".form-group").find(".help-block.err").remove()}),t("#backtop").click(function(){return t("body,html").animate({scrollTop:0}),!1}),t(document).scroll(function(){t(this).scrollTop()>720?t("#backtop").removeClass("hidden"):t("#backtop").addClass("hidden")}),t(".topframe").length&&t(".topframe .close").click(function(e){t(this).parent().remove(),0!==t(".topframe").length&&t(".topframe .content").text()||t("body").removeClass("have-notify")}),window.SFHacker={setOldVersion:function(){t.cookie("v","old"),window.location.reload()},unSetOldVersion:function(){t.removeCookie("v",{path:"/"}),window.location.reload()},makePureTextarea:function(){t.cookie("typemode","native"),window.location.reload()},unMakePureTextarea:function(){t.removeCookie("typemode",{path:"/"}),window.location.reload()}},t("body").on("click",".SFLogin",function(t){t.preventDefault(),r.register()}),t("body").on("click",".SFRegister",function(t){t.preventDefault(),r.login()}),t("body").on("click",".phoneLogin",function(t){t.preventDefault(),r.phonelogin()}),t(".notlogin").on("click",function(e){e.preventDefault();var n=t(this);r.login(function(){n.removeClass("notlogin")})}),t(".captchaInput img").on("click",function(){var e=Date.parse(new Date);t(this).attr("src","/user/captcha?w=240&h=50&t="+e)});var y=function(t){var e=t.closest("form"),n=e.find(".captchaInput .captcha"),o=n.data("src");n.attr("src",o),e.find(".captchaInput").removeClass("hidden")};t("body").on("focus",'input[name="phone"]',function(){var e=t(this);e.closest("form").find(".captchaInput .captcha").attr("src")||y(e)}),function(){window.isBindPage||t("body").on("click",".login-modal .login-wrap .js-user-login__phone-vaild-btn",function(){var e=t(this),n=60,o=void 0,i=function(){n>1?(n--,e.text(n+"s")):(clearInterval(o),e.text("获取验证码"),e.prop("disabled",!1))},r={},a=t(this).closest("form").find("input:not(.hide,hidden)");a.each(function(){var e=t(this),n=e.attr("name"),o=e.val();r[n]=o}),t.post("/api/user/phone/register/send",r,function(t){t.status||(e.prop("disabled",!0),o=setInterval(i,1e3))})})}(),t("body").on("click",".bindphone-model .user-bind__phone-vaild-btn",function(){var e=t(this),n=60,o=void 0,i=function(){n>1?(n--,e.text(n+"s")):(clearInterval(o),e.text("获取验证码"),e.prop("disabled",!1))};t.post("/api/user/phone/bind",{phone:t(".bindphone--phone").val()},function(t){t.status||(e.prop("disabled",!0),o=setInterval(i,1e3))})}),t("body").on("click",".phonelogin-modal .user-bind__phone-vaild-btn",function(){var e=t(this),n=60,o=void 0,i=function(){n>1?(n--,e.text(n+"s")):(clearInterval(o),e.text("获取验证码"),e.prop("disabled",!1))};t.post("/api/user/phone/phoneloginsend",{phone:t(".phonelogin--phone").val()},function(t){t.status||(e.prop("disabled",!0),o=setInterval(i,1e3))})}),h=function(e,n,o,i){var r;r=e,r.on("shown.bs.modal",function(){return t.post("/api/user/active/alert",function(t){})}),r.length>0&&t(".write-btns a").each(function(e,n){t(this).click(function(t){return r.modal("show"),!1})}),r.find(".activate-form").on("submit",function(e){var n;return e.preventDefault(),n=t(this),t.post(o,{mail:n.find(".mail").val()},function(e){0===e.status&&(n.parent().find(".session-mail").text(n.find(".mail").val()),t(".activate-showmail").show(),t(".activate-form").hide(),location.reload())}),!1}),r.find(".activate-resend",r).click(function(e){var o,r,a,s;r=t(this),o=r.siblings("span").find("span"),a=void 0,s=void 0,a=120,a--,t.post(n,function(e){var n;0===e.status?(t(".company-activete-tips").length&&t(".company-activete-tips").html(null!=(n='
    '+e.message)?n:e.data[1]+"
    "),i&&i(),s=setInterval(function(){return 0===a?(clearInterval(s),r.show(),r.siblings("span").hide()):(r.hide(),r.siblings("span").show(),o.text(a--))},1e3)):(t(".company-activete-tips").length&&(e.message?t(".company-activete-tips").html('
    '+e.message+"
    "):t(".company-activete-tips").html('
    '+e.data[1]+"
    ")),setTimeout(function(){return t(".company-activete-tips").length&&t(".company-activete-tips").html('
    激活邮件已发送 (120
    '),r.show()},9e5))})})},h(t("#activate"),"/api/user/reactivate","/api/user/activate/mail"),h(t("#companyActivate"),"/api/company/reactivate","/api/settings/mail/edit"),t(".side-ask [class*=btn-sn-]").click(function(e){e.preventDefault(),window.open(t(this).attr("href"),"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500")}),function(){t("body").on("click",".activate__step--init input[name=activate_type]",function(){var e=t(this),n=e.val();t('.activate__step--init .form-group[data-type="'+n+'"]').removeClass("hide"),"phone"===n?t(".activate__step--init .form-group[data-type=mail]").addClass("hide"):"mail"===n&&t(".activate__step--init .form-group[data-type=phone]").addClass("hide")}),t("body").on("click",".activate__step--init .activate__step-code-btn",function(){var e=void 0,n=t(this),o=(t(".activate__step-code-value"),t(".activate__step-phone-value")),i=60,r=function(){i<1?(n.text("获取验证码"),n.prop("disabled",!1),clearInterval(e)):n.text(--i+"s")};n.prop("disabled",!0),t.post("/api/user/phone/activate/send",{phone:o.val()},function(t){t.status?n.prop("disabled",!1):e=setInterval(r,1e3)})}),t("body").on("click",".activate-change",function(e){t(".activate-showmail").hide(),t(".activate-form").show()}),t("#activate").on("show.bs.modal",function(){var e=t(".activate__step--init>form").serializeArray(),n={};e.map(function(t){n[t.name]=t.value}),n.mail&&n.mail.length>0&&(t(".activate__step--init input[value=mail]").trigger("click"),setTimeout(function(){},50),t(".activate__step--init .btn-primary").trigger("click"))}),t("body").on("click",".activate__step--init .btn-primary",function(){var e=t(this),n=t(".activate__step--init>form").serializeArray(),o={};if(n.map(function(t){o[t.name]=t.value}),o.hasOwnProperty("activate_type"))if("mail"===o.activate_type){o={mail:o.mail};var i=function(e,n){t(".activate__step--mail .session-mail").text(e);var o="",i={"mail.google.com":["gmail.com"],"mail.qq.com":["qq.com","vip.qq.com","foxmail.com"],"mail.163.com":["163.com"],"mail.126.com":["126.com"],"mail.sina.com":["sina.com","vip.sina.com","sina.cn"],"mail.sohu.com":["sohu.com"],"mail.139.com":["139.com"],"mail.wo.com.cn":["wo.com.cn"],"mail.189.cn":["189.cn"],"mail.21cn.com":["21.cn"],"mail.aliyun.com":["aliyun.com"],"mail.yahoo.com":["yahoo.com"]};for(var r in i){var a=i[r],s=a.find(function(t){return t===e.split("@")[1]});s&&(o=r)}o.length>0?t(".activate__step--mail .activate_step-mail-goto").attr("href","http://"+o):t(".activate__step--mail .activate_step-mail-goto").hide();var l="mailto:pr@segmentfault.com?subject=邮箱 "+e+" 无法激活&body=请描述具体内容";t(".activate__step-contact").attr("href",l);var c=t(".activate__step-reactivate-btn");n||c.addClass("disabled");var u=void 0,p=120,d=function(){p>0?c.text("激活邮件已发送("+p--+"s)"):(c.text("重新发送激活邮件"),clearInterval(u),c.removeClass("disabled"))};return n||(u=setInterval(d,1e3)),{destory:function(){c.text("重新发送激活邮件"),clearInterval(u),c.removeClass("disabled")}}},r=e.closest(".activate__step");r.next(".activate__step").removeClass("hide"),r.remove();var a=i(o.mail,!0);0!=t('input[name="mail"]').data("mail").length&&t.post("/api/user/activate/mail",o,function(t){t.status&&a.destory()}),t(".activate__step-reactivate-btn").on("click",function(){a=i(o.mail),t.post("/api/user/activate/mail",o,function(t){t.status&&a.destory()})}),t(".activate-form").on("click",".btn-primary",function(){var e=t(".activate-form .change-mail").val();e.length>0&&(a.destory(),a=i(e),t.post("/api/user/activate/mail",{mail:e},function(e){e.status?a.destory():(t(".activate-showmail").show(),t(".activate-form").hide())}))})}else delete o.mail,delete o.activate_type,t.post("/api/user/activate/phone",o,function(t){t.status||location.reload()})})}();var b=window.location.href,w=/openInApp=1/.test(b);!function(){if(r.userId&&/micromessenger/.test(navigator.userAgent.toLowerCase()));else if(o("any")&&!w){var e='
    \n \n
    \n
    SegmentFault
    \n

    一起探索更多未知

    \n 下载 App\n
    ';t("body").append(e)}}(),g(document.body.clientWidth);try{localStorage.getItem("alert-tos")||t(".alert--tos").removeClass("hide")}catch(t){}if(t(".read-tos").on("click",function(){try{localStorage.setItem("alert-tos",1)}catch(t){}t(this).hasClass("close")||(location.href=t(this).data("url"))}),r.userId)if(ddosMode){var x="/api/user/stat";t.get(x,function(e){var n=e.data,o=n.events,i=n.messages,a=(n.newestLive,localStorage.getItem("lastLive"),i),s=o;a>0?(r.titleRender.set("message",a),a>99&&(a="..."),t("#letterCount").siblings(".has-unread__count").remove(),t("#letterCount").after(''+a+""),t("#letterCount-response").find(".redpoint-response").remove(),t("#letterCount-response").append(''+a+"")):(r.titleRender.clear("message"),t(".letter .has-unread__count").remove(),t(".letter-response .redpoint-response").remove()),s>0?(r.titleRender.set("event",s),s>99&&(s="..."),t("#messageCount").siblings(".has-unread__count").remove(),t("#messageCount").after(''+s+""),t("#messageCount-response").find(".redpoint-response").remove(),t("#messageCount-response").append(''+s+"")):(r.titleRender.clear("event"),t(".message .has-unread__count").remove(),t(".message-response .redpoint-response").remove()),s>0||a>0?t(".user-avatar").after('
    '):t(".user .has-unread__count").remove()})}else{var D=function(e){S=!0;var n=i("segmentfault.com:"+e,{autoConnect:!1,reconnection:!0,reconnectionDelayMax:5e3,reconnectionAttempts:3});return n.emit("login",t.cookie("PHPSESSID")),n.on("event",function(e){var n=e.message,o=e.event;n>0?(r.titleRender.set("message",n),n>99&&(n="..."),t("#letterCount").siblings(".has-unread__count").remove(),t("#letterCount").after(''+n+""),t("#letterCount-response").find(".redpoint-response").remove(),t("#letterCount-response").append(''+n+"")):(r.titleRender.clear("message"),t(".letter .has-unread__count").remove(),t(".letter-response .redpoint-response").remove()),o>0?(r.titleRender.set("event",o),o>99&&(o="..."),t("#messageCount").siblings(".has-unread__count").remove(),t("#messageCount").after(''+o+""),t("#messageCount-response").find(".redpoint-response").remove(),t("#messageCount-response").append(''+o+"")):(r.titleRender.clear("event"),t(".message .has-unread__count").remove(),t(".message-response .redpoint-response").remove()),o>0||n>0?t(".user-avatar").after('
    '):t(".user .has-unread__count").remove()}),n.open(),n},C=9443,S=!1,$=null;if(window.socket=D(C),"undefined"!=typeof document.hasFocus){var E=document.hasFocus();setInterval(function(){var t=document.hasFocus();if(E!=t)if(E=t,t)$&&(clearTimeout($),$=null),!S&&window.socket&&(S=!0,window.socket.connect());else{if($)return;$=setTimeout(function(){S&&(S=!1,window.socket.close())},3e4)}},3e3)}}return t(".topframe").text().indexOf(!0)&&t(".send-mail").click(),t("#loginBanner").on("click",".fa-times-circle",function(e){e.preventDefault(),t("#loginBanner").hide()}),t("#loginBanner").on("click",".login_now",function(t){t.preventDefault(),r.login()}),t(".bindphone").on("click",function(t){t.preventDefault(),r.bindphone()}),jQuery(function(t){t(document).ready(function(){setTimeout(function(){t(".ad-should-be-fixed").stickUp()},2e3)})}),function(){t("#notices").length&&t.get("/api/notice/newest",function(t){0!==t.data.length&&(document.querySelector("#notices").classList.remove("hidden"),document.querySelector("#notices .report").setAttribute("href",t.data[0].url),document.querySelector("#notices .report").innerHTML=t.data[0].title)})}(),function(){var n=t("#isRemoteLogin").length>0;if(n){var o=t("#isRemoteLogin").data("phone").toString()||"",i=t("#isRemoteLogin").data("mail").toString()||"",r=o.slice(0,3)+"****"+o.slice(-4),a=i.slice(0,2)+"****"+i.slice(i.indexOf("@"),i.length);e({modalSize:"modal-md",title:"异地登录验证",backdrop:"static",content:'\n
    \n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n\n
    \n \n
    \n \n
    \n
    \n\n \n\n
    \n \n
    \n
    \n \n \n \n \n
    \n
    \n
    \n\n \n\n
    \n
    \n \n
    \n
    \n
    \n
    \n\n \n\n
    \n ',hideClose:!0,hideDone:!0,show:function(){var e=function(){var n=t("#remoteLoginActivate .captcha");return n.attr("src",n.data("src")),(e=function(){return null})()};t("body").on("click","#remoteLoginActivate input[name=activate_type]",function(){var n=t(this),o=n.val();t('#remoteLoginActivate .form-group[data-type="'+o+'"]').removeClass("hidden"),"phone"===o?(t("#remoteLoginActivate .form-group[data-type=mail]").addClass("hidden"),e()):"mail"===o&&t("#remoteLoginActivate .form-group[data-type=phone]").addClass("hidden")}),o||(t('input[value="mail"]').trigger("click"),t('input[name="activate_type"]').prop("disabled","disabled")),i||t('input[name="activate_type"]').prop("disabled","disabled"),t("body").on("click","#remoteLoginActivate .get-code-btn",function(e){if(t("#remoteLoginActivate .captch-block").hasClass("hidden")){t("#remoteLoginActivate .captch-block").removeClass("hidden");var n=t("#remoteLoginActivate .captcha");n.attr("src",n.data("src"))}else{var i=void 0,r=t(this),a=(t(".activate__step-phone-value"),60),s=function(){a<1?(r.text("获取验证码"),r.prop("disabled",!1),clearInterval(i)):r.text(--a+"s")};r.prop("disabled",!0);var l="/api/user/phone/remote-login/send",c=t('#remoteLoginActivate input[name="cap"]').val();t.post(l,{phone:o,cap:c},function(t){0==t.status?i=setInterval(s,1e3):r.prop("disabled",!1)})}}),t("body").on("click","#remoteLoginActivate .captcha",function(e){var n=t(e.target);n.attr("src",n.data("src"))}),t("body").on("click","#remoteLoginActivate .submit",function(e){var n=t("#remoteLoginActivate .form-group[data-type=mail]").hasClass("hidden")?"phone":"mail";if("phone"==n){var r="/api/user/phone/remote-login/active",a=t('#remoteLoginActivate input[name="code"]').val();t.post(r,{phone:o,code:a},function(t){0==t.status&&location.reload()})}else{var s="/api/user/mail/remote-login/send";t.post(s,{mail:i},function(e){if(0==e.status){t(".activate--mail").removeClass("hidden"),t(".activate--init").addClass("hidden");var n=function(e,n){var o="",i={"mail.google.com":["gmail.com"],"mail.qq.com":["qq.com","vip.qq.com","foxmail.com"],"mail.163.com":["163.com"],"mail.126.com":["126.com"],"mail.sina.com":["sina.com","vip.sina.com","sina.cn"],"mail.sohu.com":["sohu.com"],"mail.139.com":["139.com"],"mail.wo.com.cn":["wo.com.cn"],"mail.189.cn":["189.cn"],"mail.21cn.com":["21.cn"],"mail.aliyun.com":["aliyun.com"],"mail.yahoo.com":["yahoo.com"]};for(var r in i){var a=i[r],s=a.find(function(t){return t===e.split("@")[1]});s&&(o=r)}o.length>0?t("#remoteLoginActivate .activate_step-mail-goto").attr("href","http://"+o):t("#remoteLoginActivate .activate_step-mail-goto").hide();var l="mailto:pr@segmentfault.com?subject=邮箱 "+e+" 无法进行异地登录验证&body=请描述具体内容";t(".activate__step-contact").attr("href",l);var c=t(".activate__step-reactivate-btn");n||c.addClass("disabled");var u=void 0,p=120,d=function(){p>0?c.text("激活邮件已发送("+p--+"s)"):(c.text("重新发送激活邮件"),clearInterval(u),c.removeClass("disabled"))};return n||(u=setInterval(d,1e3)),{destory:function(){c.text("重新发送激活邮件"),clearInterval(u),c.removeClass("disabled")}}},o=n(i,!0);t(".activate__step-reactivate-btn").on("click",function(){o=n(i),t.post("/api/user/mail/remote-login/send",{mail:i},function(e){if(e.status){o.destory();var n=e.data[1],i="";t.each(n,function(t,e){i=e,i&&alert(i)})}})})}})}})}})}}(),r}),!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define("pingpp",[],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.pingpp=t()}}(function(){return function t(e,n,o){function i(a,s){if(!n[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(r)return r(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n?n:t)},u,u.exports,t,e,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a=200&&e<400&&"success"==t)o.innerCallback("success");else{var n="http_code:"+e+";response:"+t;o.innerCallback("fail",o.error("testmode_notify_fail",n))}},function(){o.innerCallback("fail",o.error("network_err"))})}}}},{"../callbacks":1,"../mods":21,"../stash":23,"../utils":25}],15:[function(t,e,n){var o=t("../utils"),i=t("../callbacks"),r={}.hasOwnProperty;e.exports={handleCharge:function(t){var e=t.credential[t.channel];"string"==typeof e?o.redirectTo(e):"object"==typeof e&&r.call(e,"url")?o.redirectTo(e.url):i.innerCallback("fail",i.error("invalid_credential","credential 格式不正确"))}}},{"../callbacks":1,"../utils":25}],16:[function(t,e,n){var o=t("../utils"),i=t("../callbacks"),r={}.hasOwnProperty;e.exports={YEEPAY_WAP_URL:"https://ok.yeepay.com/paymobile/api/pay/request",YEEPAY_WAP_TEST_URL:"http://mobiletest.yeepay.com/paymobile/api/pay/request",handleCharge:function(t){for(var e=t.channel,n=t.credential[e],a=["merchantaccount","encryptkey","data"],s=0;s>16)+(e>>16)+(n>>16);return o<<16|65535&n}function n(t,e){return t<>>32-e}function o(e,o,i,r,a,s){return t(n(t(t(o,e),t(r,s)),a),i)}function i(t,e,n,i,r,a,s){return o(e&n|~e&i,t,e,r,a,s)}function r(t,e,n,i,r,a,s){return o(e&i|n&~i,t,e,r,a,s)}function a(t,e,n,i,r,a,s){return o(e^n^i,t,e,r,a,s)}function s(t,e,n,i,r,a,s){return o(n^(e|~i),t,e,r,a,s)}function l(e,n){e[n>>5]|=128<>>9<<4)+14]=n;var o,l,c,u,p,d=1732584193,h=-271733879,f=-1732584194,m=271733878;for(o=0;o>5]>>>e%32&255);return n}function u(t){var e,n=[];for(n[(t.length>>2)-1]=void 0,e=0;e>5]|=(255&t.charCodeAt(e/8))<16&&(i=l(i,8*t.length)),n=0;n<16;n+=1)r[n]=909522486^i[n],a[n]=1549556828^i[n];return o=l(r.concat(u(e)),512+8*e.length),c(l(a.concat(o),640))}function h(t){var e,n,o="0123456789abcdef",i="";for(n=0;n>>4&15)+o.charAt(15&e);return i}function f(t){return unescape(encodeURIComponent(t))}function m(t){return p(f(t))}function g(t){return h(m(t))}function v(t,e){return d(f(t),f(e))}function y(t,e){return h(v(t,e))}function b(t,e,n){return e?n?v(e,t):y(e,t):n?m(t):g(t)}e.exports=b}()},{}],20:[function(t,e,n){var o=t("./version").v,i=t("./testmode"),r=t("./callbacks"),a=t("./mods"),s=t("./stash"),l=t("./collection"),c=t("./payment_elements"),u={}.hasOwnProperty,p=function(){t("./init").init()};p.prototype={version:o,createPayment:function(t,e,n,o){if("function"==typeof e&&(r.userCallback=e),c.init(t),!u.call(c,"id"))return void r.innerCallback("fail",r.error("invalid_charge","no_charge_id"));if(!u.call(c,"channel"))return void r.innerCallback("fail",r.error("invalid_charge","no_channel"));u.call(c,"app")&&("string"==typeof c.app?s.app_id=c.app:"object"==typeof c.app&&"string"==typeof c.app.id&&(s.app_id=c.app.id)),l.report({type:"pure_sdk_click",channel:c.channel,ch_id:c.id});var p=c.channel;if(!u.call(c,"credential"))return void r.innerCallback("fail",r.error("invalid_charge","no_credential"));if(!c.credential)return void r.innerCallback("fail",r.error("invalid_credential","credential_is_undefined"));if(!u.call(c.credential,p))return void r.innerCallback("fail",r.error("invalid_credential","credential_is_incorrect"));if(!u.call(c,"livemode"))return void r.innerCallback("fail",r.error("invalid_charge","no_livemode_field"));var d=a.getChannelModule(p);return"undefined"==typeof d?(console.error('channel module "'+p+'" is undefined'),void r.innerCallback("fail",r.error("invalid_channel",'channel module "'+p+'" is undefined'))):c.livemode===!1?void(u.call(d,"runTestMode")?d.runTestMode(c):i.runTestMode(c)):("undefined"!=typeof n&&(s.signature=n),"boolean"==typeof o&&(s.debug=o),void d.handleCharge(c))},setAPURL:function(t){s.APURL=t}},e.exports=new p},{"./callbacks":1,"./collection":17,"./init":18,"./mods":21,"./payment_elements":22,"./stash":23,"./testmode":24,"./version":26}],21:[function(t,e,n){var o={}.hasOwnProperty,i={};e.exports=i,i.channels={alipay_pc_direct:t("./channels/alipay_pc_direct"),alipay_wap:t("./channels/alipay_wap"),bfb_wap:t("./channels/bfb_wap"),cp_b2b:t("./channels/cp_b2b"),fqlpay_qr:t("./channels/fqlpay_qr"),fqlpay_wap:t("./channels/fqlpay_wap"),jdpay_wap:t("./channels/jdpay_wap"),qpay_pub:t("./channels/qpay_pub"),upacp_pc:t("./channels/upacp_pc"),upacp_wap:t("./channels/upacp_wap"),wx_lite:t("./channels/wx_lite"),wx_pub:t("./channels/wx_pub"),wx_wap:t("./channels/wx_wap"),yeepay_wap:t("./channels/yeepay_wap")},i.extras={},i.getChannelModule=function(t){if(o.call(i.channels,t))return i.channels[t]},i.getExtraModule=function(t){if(o.call(i.extras,t))return i.extras[t]}},{"./channels/alipay_pc_direct":2,"./channels/alipay_wap":3,"./channels/bfb_wap":4,"./channels/cp_b2b":6,"./channels/fqlpay_qr":7,"./channels/fqlpay_wap":8,"./channels/jdpay_wap":9,"./channels/qpay_pub":10,"./channels/upacp_pc":11,"./channels/upacp_wap":12,"./channels/wx_lite":13,"./channels/wx_pub":14,"./channels/wx_wap":15,"./channels/yeepay_wap":16}],22:[function(t,e,n){var o=t("./callbacks"),i={}.hasOwnProperty;e.exports={id:null,or_id:null,channel:null,app:null,credential:{},extra:null,livemode:null,order_no:null,time_expire:null,init:function(t){var e;if("string"==typeof t)try{e=JSON.parse(t)}catch(t){return void o.innerCallback("fail",o.error("json_decode_fail",t))}else e=t;if("undefined"==typeof e)return void o.innerCallback("fail",o.error("json_decode_fail"));if(i.call(e,"object")&&"order"==e.object){e.or_id=e.id,e.id=e.charge,e.order_no=e.merchant_order_no;var n=e.charge_essentials;e.channel=n.channel,e.credential=n.credential,e.extra=n.extra}for(var r in this)i.call(e,r)&&(this[r]=e[r]);return this},clear:function(){for(var t in this)"function"!=typeof this[t]&&(this[t]=null)}}},{"./callbacks":1}],23:[function(t,e,n){e.exports={}},{}],24:[function(t,e,n){var o=t("./utils"),i={}.hasOwnProperty;e.exports={PINGPP_MOCK_URL:"http://sissi.pingxx.com/mock.php",runTestMode:function(t){var e={ch_id:t.id,scheme:"http",channel:t.channel};i.call(t,"or_id")&&null!==t.or_id&&(e.or_id=t.or_id),i.call(t,"order_no")?e.order_no=t.order_no:i.call(t,"orderNo")&&(e.order_no=t.orderNo),i.call(t,"time_expire")?e.time_expire=t.time_expire:i.call(t,"timeExpire")&&(e.time_expire=t.timeExpire),i.call(t,"extra")&&(e.extra=encodeURIComponent(JSON.stringify(t.extra))),o.redirectTo(this.PINGPP_MOCK_URL+"?"+o.stringifyData(e))}}},{"./utils":25}],25:[function(t,e,n){var o={}.hasOwnProperty,i=e.exports={stringifyData:function(t,e,n){"undefined"==typeof n&&(n=!1);var i=[];for(var r in t)o.call(t,r)&&"function"!=typeof t[r]&&("bfb_wap"==e&&"url"==r||"yeepay_wap"==e&&"mode"==r||"channel_url"!=r&&i.push(r+"="+(n?encodeURIComponent(t[r]):t[r])));return i.join("&")},request:function(t,e,n,r,a,s){if("undefined"==typeof XMLHttpRequest)return void console.log("Function XMLHttpRequest is undefined.");var l=new XMLHttpRequest;if("undefined"!=typeof l.timeout&&(l.timeout=6e3),e=e.toUpperCase(),"GET"===e&&"object"==typeof n&&n&&(t+="?"+i.stringifyData(n,"",!0)),l.open(e,t,!0),"undefined"!=typeof s)for(var c in s)o.call(s,c)&&l.setRequestHeader(c,s[c]);"POST"===e?(l.setRequestHeader("Content-type","application/json; charset=utf-8"),l.send(JSON.stringify(n))):l.send(),"undefined"==typeof r&&(r=function(){}),"undefined"==typeof a&&(a=function(){}),l.onreadystatechange=function(){4==l.readyState&&r(l.responseText,l.status,l)},l.onerror=function(t){a(l,0,t)}},formSubmit:function(t,e,n){if("undefined"==typeof window)return void console.log("Not a browser, form submit url: "+t);var i=document.createElement("form");i.setAttribute("method",e),i.setAttribute("action",t);for(var r in n)if(o.call(n,r)){var a=document.createElement("input");a.setAttribute("type","hidden"),a.setAttribute("name",r),a.setAttribute("value",n[r]),i.appendChild(a)}document.body.appendChild(i),i.submit()},randomString:function(t){"undefined"==typeof t&&(t=32);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length,o="",i=0;i',i=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent","whiteSpace"],r=t(o).data("autosize",!0)[0];r.style.lineHeight="99px","99px"===t(r).css("lineHeight")&&i.push("lineHeight"),r.style.lineHeight="",t.fn.autosize=function(o){return this.length?(o=t.extend({},n,o||{}),r.parentNode!==document.body&&t(document.body).append(r),this.each(function(){function n(){var e,n=!!window.getComputedStyle&&window.getComputedStyle(d,null);n?(e=d.getBoundingClientRect().width,0!==e&&"number"==typeof e||(e=parseInt(n.width,10)),t.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(t,o){e-=parseInt(n[o],10)})):e=h.width(),r.style.width=Math.max(e,0)+"px"}function a(){var a={};if(e=d,r.className=o.className,r.id=o.id,c=parseInt(h.css("maxHeight"),10),t.each(i,function(t,e){a[e]=h.css(e)}),t(r).css(a).attr("wrap",h.attr("wrap")),n(),window.chrome){var s=d.style.width;d.style.width="0px";d.offsetWidth;d.style.width=s}}function s(){var t,i;e!==d?a():n(),!d.value&&o.placeholder?r.value=(h.attr("placeholder")||"")+o.append:r.value=d.value+o.append,r.style.overflowY=d.style.overflowY,i=parseInt(d.style.height,10),r.scrollTop=0,r.scrollTop=9e4,t=r.scrollTop,c&&t>c?(d.style.overflowY="scroll",t=c):(d.style.overflowY="hidden",t
    ")),this.model=new s(this),this.view=new l(this)}return n.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},n.prototype.init=function(e){return this.setting=t.extend({},this.setting||t.fn.atwho.default,e),this.view.init(),this.model.reload(this.setting.data)},n.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},n.prototype.call_default=function(){var e,n,o;o=arguments[0],e=2<=arguments.length?c.call(arguments,1):[];try{return r[o].apply(this,e)}catch(e){return n=e,t.error(""+n+" Or maybe At.js doesn't have function "+o)}},n.prototype.trigger=function(t,e){var n,o;return null==e&&(e=[]),e.push(this),n=this.get_opt("alias"),o=n?""+t+"-"+n+".atwho":""+t+".atwho",this.$inputor.trigger(o,e)},n.prototype.callbacks=function(t){return this.get_opt("callbacks")[t]||r[t]},n.prototype.get_opt=function(t,e){var n;try{return this.setting[t]}catch(t){return n=t,null}},n.prototype.content=function(){return this.$inputor.is("textarea, input")?this.$inputor.val():this.$inputor.text()},n.prototype.catch_query=function(){var t,e,n,o,i,r;return e=this.content(),t=this.$inputor.caret("pos",{iframe:this.app.iframe}),r=e.slice(0,t),o=this.callbacks("matcher").call(this,this.at,r,this.get_opt("start_with_space")),"string"==typeof o&&o.length<=this.get_opt("max_len",20)?(i=t-o.length,n=i+o.length,this.pos=i,o={text:o,head_pos:i,end_pos:n},this.trigger("matched",[this.at,o.text])):(o=null,this.view.hide()),this.query=o},n.prototype.rect=function(){var t,e;if(t=this.$inputor.caret("offset",this.pos-1,{iframe:this.app.iframe}))return"true"===this.$inputor.attr("contentEditable")&&(t=this.cur_rect||(this.cur_rect=t)||t),e=this.app.document.selection?0:2,{left:t.left,top:t.top,bottom:t.top+t.height+e}},n.prototype.reset_rect=function(){if("true"===this.$inputor.attr("contentEditable"))return this.cur_rect=null},n.prototype.mark_range=function(){if("true"===this.$inputor.attr("contentEditable")&&(this.app.window.getSelection&&(this.range=this.app.window.getSelection().getRangeAt(0)),this.app.document.selection))return this.ie8_range=this.app.document.selection.createRange()},n.prototype.insert_content_for=function(e){var n,o,i;return o=e.data("value"),i=this.get_opt("insert_tpl"),this.$inputor.is("textarea, input")||!i?o:(n=t.extend({},e.data("item-data"),{"atwho-data-value":o,"atwho-at":this.at}),this.callbacks("tpl_eval").call(this,i,n))},n.prototype.insert=function(e,n){var o,i,r,a,s,l,c,u,p;return o=this.$inputor,p=this.callbacks("inserting_wrapper").call(this,o,e,this.get_opt("suffix")),o.is("textarea, input")?(l=o.val(),c=l.slice(0,Math.max(this.query.head_pos-this.at.length,0)),u=""+c+p+l.slice(this.query.end_pos||0),o.val(u),o.caret("pos",c.length+p.length,{iframe:this.app.iframe})):(a=this.range)?(r=a.startOffset-(this.query.end_pos-this.query.head_pos)-this.at.length,a.setStart(a.endContainer,Math.max(r,0)),a.setEnd(a.endContainer,a.endOffset),a.deleteContents(),i=t(p,this.app.document)[0],a.insertNode(i),a.setEndAfter(i),a.collapse(!1),s=this.app.window.getSelection(),s.removeAllRanges(),s.addRange(a)):(a=this.ie8_range)&&(a.moveStart("character",this.query.end_pos-this.query.head_pos-this.at.length),a.pasteHTML(p),a.collapse(!1),a.select()),o.is(":focus")||o.focus(),o.change()},n.prototype.render_view=function(t){var e;return e=this.get_opt("search_key"),t=this.callbacks("sorter").call(this,this.query.text,t.slice(0,1001),e),this.view.render(t.slice(0,this.get_opt("limit")))},n.prototype.look_up=function(){var e,n;if(e=this.catch_query())return n=function(t){return t&&t.length>0?this.render_view(t):this.view.hide()},this.model.query(e.text,t.proxy(n,this)),e},n}(),s=function(){function e(t){this.context=t,this.at=this.context.at,this.storage=this.context.$inputor}return e.prototype.destroy=function(){return this.storage.data(this.at,null)},e.prototype.saved=function(){return this.fetch()>0},e.prototype.query=function(t,e){var n,o,i;return n=this.fetch(),o=this.context.get_opt("search_key"),n=this.context.callbacks("filter").call(this.context,t,n,o)||[],i=this.context.callbacks("remote_filter"),n.length>0||!i&&0===n.length?e(n):i.call(this.context,t,e)},e.prototype.fetch=function(){return this.storage.data(this.at)||[]},e.prototype.save=function(t){return this.storage.data(this.at,this.context.callbacks("before_save").call(this.context,t||[]))},e.prototype.load=function(t){if(!this.saved()&&t)return this._load(t)},e.prototype.reload=function(t){return this._load(t)},e.prototype._load=function(e){return"string"==typeof e?t.ajax(e,{dataType:"json"}).done(function(t){return function(e){return t.save(e)}}(this)):this.save(e)},e}(),l=function(){function e(e){this.context=e,this.$el=t("
      "),this.timeout_id=null,this.context.$el.append(this.$el),this.bind_event()}return e.prototype.init=function(){var t;return t=this.context.get_opt("alias")||this.context.at.charCodeAt(0),this.$el.attr({id:"at-view-"+t})},e.prototype.destroy=function(){return this.$el.remove()},e.prototype.bind_event=function(){var e;return e=this.$el.find("ul"),e.on("mouseenter.atwho-view","li",function(n){return e.find(".cur").removeClass("cur"),t(n.currentTarget).addClass("cur")}).on("click",function(t){return function(e){return t.choose(e),e.preventDefault()}}(this))},e.prototype.visible=function(){return this.$el.is(":visible")},e.prototype.choose=function(t){var e,n;if((e=this.$el.find(".cur")).length&&(n=this.context.insert_content_for(e),this.context.insert(this.context.callbacks("before_insert").call(this.context,n,e),e),this.context.trigger("inserted",[e,t]),this.hide(t)),this.context.get_opt("hide_without_suffix"))return this.stop_showing=!0},e.prototype.reposition=function(e){var n,o;return e.bottom+this.$el.height()-t(window).scrollTop()>t(window).height()&&(e.bottom=e.top-this.$el.height()),n={left:e.left,top:e.bottom},null!=(o=this.context.callbacks("before_reposition"))&&o.call(this.context,n),this.$el.offset(n),this.context.trigger("reposition",[n])},e.prototype.next=function(){var t,e;return t=this.$el.find(".cur").removeClass("cur"),e=t.next(),e.length||(e=this.$el.find("li:first")),e.addClass("cur")},e.prototype.prev=function(){var t,e;return t=this.$el.find(".cur").removeClass("cur"),e=t.prev(),e.length||(e=this.$el.find("li:last")),e.addClass("cur")},e.prototype.show=function(){var t;return this.stop_showing?void(this.stop_showing=!1):(this.context.mark_range(),this.visible()||(this.$el.show(),this.context.trigger("shown")),(t=this.context.rect())?this.reposition(t):void 0)},e.prototype.hide=function(t,e){var n;if(this.visible())return isNaN(e)?(this.context.reset_rect(),this.$el.hide(),this.context.trigger("hidden",[t])):(n=function(t){return function(){return t.hide()}}(this),clearTimeout(this.timeout_id),this.timeout_id=setTimeout(n,e))},e.prototype.render=function(e){var n,o,i,r,a,s,l;if(!(t.isArray(e)&&e.length>0))return void this.hide();for(this.$el.find("ul").empty(),o=this.$el.find("ul"),a=this.context.get_opt("tpl"),s=0,l=e.length;s-1&&a.push(o);return a.sort(function(t,e){return t.atwho_order-e.atwho_order})},tpl_eval:function(t,e){var n;try{return t.replace(/\$\{([^\}]*)\}/g,function(t,n,o){return e[n]})}catch(t){return n=t,""}},highlighter:function(t,e){var n;return e?(n=new RegExp(">\\s*(\\w*?)("+e.replace("+","\\+")+")(\\w*)\\s*<","ig"),t.replace(n,function(t,e,n,o){return"> "+e+""+n+""+o+" <"})):t},before_insert:function(t,e){return t},inserting_wrapper:function(t,e,n){var o,i;return o=""===n?n:n||" ",t.is("textarea, input")?""+e+o:"true"===t.attr("contentEditable")?(o=""===n?n:n||" ",/firefox/i.test(navigator.userAgent)?i=""+e+o+"":(n=""+o+"",i=""+e+n+""),this.app.document.selection&&(i=""+e+""),i):void 0}},n={load:function(t,e){var n;if(n=this.controller(t))return n.model.load(e)},setIframe:function(t){return this.setIframe(t),null},run:function(){return this.dispatch()},destroy:function(){return this.shutdown(),this.$inputor.data("atwho",null)}},e=t("
      "),t.fn.atwho=function(i){var r,a;return a=arguments,t("body").append(e),r=null,this.filter("textarea, input, [contenteditable=true]").each(function(){var e,s;return(s=(e=t(this)).data("atwho"))||e.data("atwho",s=new o(this)),"object"!=typeof i&&i?n[i]&&s?r=n[i].apply(s,Array.prototype.slice.call(a,1)):t.error("Method "+i+" does not exist on jQuery.caret"):s.reg(i.at,i)}),r||this},t.fn.atwho.default={at:void 0,alias:void 0,data:null,tpl:"
    • ${name}
    • ",insert_tpl:"${atwho-data-value}",callbacks:r,search_key:"name",suffix:void 0,hide_without_suffix:!1,start_with_space:!0,highlight_first:!0,limit:5,max_len:20,display_timeout:300,delay:null}})}.call(this),function(){!function(t){return"function"==typeof define&&define.amd?define("caret",["jquery"],t):t(window.jQuery)}(function(t){"use strict";var e,n,o,i,r,a,s,l,c,u,p;return u="caret",e=function(){function e(t){this.$inputor=t,this.domInputor=this.$inputor[0]}return e.prototype.setPos=function(){return this.domInputor},e.prototype.getIEPosition=function(){return t.noop()},e.prototype.getPosition=function(){return t.noop()},e.prototype.getOldIEPos=function(){var t,e;return e=s.selection.createRange(),t=s.body.createTextRange(),t.moveToElementText(this.domInputor),t.setEndPoint("EndToEnd",e),t.text.length},e.prototype.getPos=function(){var t,e,n;return(n=this.range())?(t=n.cloneRange(),t.selectNodeContents(this.domInputor),t.setEnd(n.endContainer,n.endOffset),e=t.toString().length,t.detach(),e):s.selection?this.getOldIEPos():void 0},e.prototype.getOldIEOffset=function(){var t,e;return t=s.selection.createRange().duplicate(),t.moveStart("character",-1),e=t.getBoundingClientRect(),{height:e.bottom-e.top,left:e.left,top:e.top}},e.prototype.getOffset=function(){var e,n,o,i;if(c.getSelection&&(o=this.range())){if(o.endOffset-1<0)return null;e=o.cloneRange(),e.setStart(o.endContainer,o.endOffset-1),e.setEnd(o.endContainer,o.endOffset),i=e.getBoundingClientRect(),n={height:i.height,left:i.left+i.width,top:i.top},e.detach()}else s.selection&&(n=this.getOldIEOffset());return n&&!l&&(n.top+=t(c).scrollTop(),n.left+=t(c).scrollLeft()),n},e.prototype.range=function(){var t;if(c.getSelection)return t=c.getSelection(),t.rangeCount>0?t.getRangeAt(0):null},e}(),n=function(){function e(t){this.$inputor=t,this.domInputor=this.$inputor[0]}return e.prototype.getIEPos=function(){var t,e,n,o,i,r,a;return e=this.domInputor,r=s.selection.createRange(),i=0,r&&r.parentElement()===e&&(o=e.value.replace(/\r\n/g,"\n"),n=o.length,a=e.createTextRange(),a.moveToBookmark(r.getBookmark()),t=e.createTextRange(),t.collapse(!1),i=a.compareEndPoints("StartToEnd",t)>-1?n:-a.moveStart("character",-n)),i},e.prototype.getPos=function(){return s.selection?this.getIEPos():this.domInputor.selectionStart},e.prototype.setPos=function(t){var e,n;return e=this.domInputor,s.selection?(n=e.createTextRange(),n.move("character",t),n.select()):e.setSelectionRange&&e.setSelectionRange(t,t),e},e.prototype.getIEOffset=function(t){var e,n,o,i;return n=this.domInputor.createTextRange(),t||(t=this.getPos()),n.move("character",t),o=n.boundingLeft,i=n.boundingTop,e=n.boundingHeight,{left:o,top:i,height:e}},e.prototype.getOffset=function(e){var n,o,i;return n=this.$inputor,s.selection?(o=this.getIEOffset(e),o.top+=t(c).scrollTop()+n.scrollTop(),o.left+=t(c).scrollLeft()+n.scrollLeft(),o):(o=n.offset(),i=this.getPosition(e),o={left:o.left+i.left-n.scrollLeft(),top:o.top+i.top-n.scrollTop(),height:i.height})},e.prototype.getPosition=function(t){var e,n,i,r,a,s,l;return e=this.$inputor,r=function(t){return t.replace(//g,">").replace(/`/g,"`").replace(/"/g,""").replace(/\r\n|\r|\n/g,"
      ")},void 0===t&&(t=this.getPos()),l=e.val().slice(0,t),i=e.val().slice(t),a=""+r(l)+"",a+="|",a+=""+r(i)+"",s=new o(e),n=s.create(a).rect()},e.prototype.getIEPosition=function(t){var e,n,o,i,r;return o=this.getIEOffset(t),n=this.$inputor.offset(),i=o.left-n.left,r=o.top-n.top,e=o.height,{left:i,top:r,height:e}},e}(),o=function(){function e(t){this.$inputor=t}return e.prototype.css_attr=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap"],e.prototype.mirrorCss=function(){var e,n=this;return e={position:"absolute",left:-9999,top:0,zIndex:-2e4},"TEXTAREA"===this.$inputor.prop("tagName")&&this.css_attr.push("width"),t.each(this.css_attr,function(t,o){return e[o]=n.$inputor.css(o)}),e},e.prototype.create=function(e){return this.$mirror=t("
      "),this.$mirror.css(this.mirrorCss()),this.$mirror.html(e),this.$inputor.after(this.$mirror),this},e.prototype.rect=function(){var t,e,n;return t=this.$mirror.find("#caret"),e=t.position(),n={left:e.left,top:e.top,height:t.height()},this.$mirror.remove(),n},e}(),i={contentEditable:function(t){return!(!t[0].contentEditable||"true"!==t[0].contentEditable)}},a={pos:function(t){return t||0===t?this.setPos(t):this.getPos()},position:function(t){return s.selection?this.getIEPosition(t):this.getPosition(t)},offset:function(e){var n,o;return o=this.getOffset(e),l&&(n=t(l).offset(),o.top+=n.top,o.left+=n.left),o}},s=null,c=null,l=null,p=function(t){var e;return(e=null!=t?t.iframe:void 0)?(l=e,c=e.contentWindow,s=e.contentDocument||c.document):(l=void 0,c=window,s=document)},r=function(t){var e;s=t[0].ownerDocument,c=s.defaultView||s.parentWindow;try{return l=c.frameElement}catch(t){e=t}},t.fn.caret=function(o,r,s){var l;return a[o]?(t.isPlainObject(r)?(p(r),r=void 0):p(s),l=i.contentEditable(this)?new e(this):new n(this),a[o].apply(l,[r])):t.error("Method "+o+" does not exist on jQuery.caret")},t.fn.caret.EditableCaret=e,t.fn.caret.InputCaret=n,t.fn.caret.Utils=i,t.fn.caret.apis=a})}.call(this),define("commentNews",["main","jquery_autosize","atwho","caret"],function(t){"use strict";return function(t){t||(t={}),this.page=1,this.box=$(".comments--news"),this.id=this.box.data("id"),this.mod=t.mod||"",this.publishUserText=t.publishUserText||"作者",this.replyPage={},this.sort="default",this.authorId=this.box.data("author-id"),this.userId=this.box.data("user-id"),this.isAdmin=this.box.data("is-admin"),this.form=$(".comments-box-content"),this.textarea=this.form.find("textarea"),this.commentBtn=this.form.find(".btn-primary"),this.eleStatNumber=$(".comments-stat"),this.container=$(".comments-list"),this.$loading=$(".comments-loading"),this.$more=$(".comments-more"),this.singleComment='\n
      \n \n \n \n <%- comment.votes %>\n \n \n \n \n\n
      \n
      <%= comment.parsedText %>
      \n
      \n
      \n \n
      \n \n
      \n \n \n \n \n \n \n \n <% if (comment.canEdit) { %>\n \n \n \n <% }%>\n\n <% if (comment.canDelete) { %>\n \n \n \n <% } %>\n\n \n \n \n \n\n \n \n \n <%- comment.user.name %>\n \n \n <%- comment.publishUserText ? comment.publishUserText : "" %>\n \n · <%- comment.createdDate %>\n <% if (comment.canEdit) { %>\n \n <% } %>\n \n
      \n
      \n
      \n ',this.tpl='\n
      \n
      \n \n
      \n
      \n
      \n
      \n \n \n\n \n \n \n \n \n \n
      \n <%- user.name %>\n <%- publishUserText ?publishUserText:"" %> · <%- createdDate %>\n
      \n\n
      <%= parsedText %>
      \n \n
      \n \n
      \n \n

      \n \n \n <%- isLiked?\'已\':\'\' %>赞\n <%- votes>0?\'+\'+votes:\'\' %>\n \n 回复\n\n \n

      \n\n
      \n\n <% _.each(repliedComments,function(comment){ %>\n '+this.singleComment+'\n <% }) %>\n\n
      \n 添加回复\n\n <% if(repliedCommentCount>3) { %>\n \n |\n 显示更多\n \n <% } %>\n
      \n
      \n\n
      \n
      \n ',this.subTpl='\n
      \n \n \n
      \n \n
      \n
      \n ';var e=this;this.unfoldCommentArea=function(t,n,o){var i=$("[data-id="+t+"]").find(".reply-more-btn"),r=i.closest(".reply-more"),a=i.closest(".reply-item--ops"),s=i.closest(".comments-item").data("id");e.replyPage[s]=e.replyPage[s]||0;var l=++e.replyPage[s],c="/api/comment/"+s+"/more?page="+l;i.addClass("disabled"),$.get(c,function(t){if(i.removeClass("disabled"),!t.status){var s=t.data,l=e.singleComment,c=_.reduce(s.row,function(t,n){return t+_.template(l)({comment:n,authorId:e.authorId})},"");a.before(c),s.hasMore||r.remove(),n(o)}})},this.render=function(t,n,o){if(n=n||!1,o=o||"html",n){parseInt(e.authorId)!=parseInt(t.user.id)?t.publishUserText="":t.publishUserText=e.publishUserText;var i=_.template(e.tpl)(t);"news"===e.mod?e.container.prepend(i):e.container.append(i)}else{_.each(t,function(t){parseInt(e.authorId)!=parseInt(t.user.id)?t.publishUserText="":t.publishUserText=e.publishUserText,t.repliedComments&&_.each(t.repliedComments,function(t){parseInt(e.authorId)!=parseInt(t.user.id)?t.publishUserText="":t.publishUserText=e.publishUserText})});var r=_.reduce(t,function(t,n){return t+_.template(e.tpl)(n)},"");e.container[o](r)}$("textarea").autosize()},this.fetch=function(t){t=t||void 0,e.$loading.removeClass("hide"),"more"===t&&(e.page=e.page+1),"grapevineDetail"==e.mod&&(e.mod="grapevine"),$.get("/api/"+e.mod+"/"+e.id+"/comments?sort="+e.sort+"&page="+e.page,function(n){if(e.$loading.addClass("hide"),!n.status&&n.data.total>0){var o=n.data.rows,i=n.data.total;e.eleStatNumber.text(i+" 条评论"),"more"===t?e.render(o,void 0,"append"):e.render(o),n.data.hasMore&&e.$more.removeClass("hide")}})},this.init=function(){window.commentDeleteClass=function(t){return t?"":"hide"},e.textarea.atwho({at:"@",callbacks:{remote_filter:function(t,n){var o=void 0;if(o=e.box.data("id")+"",t){if(t)return $.getJSON("/api/users/search",{q:t},function(t){t.status||n(t.data)})}else if(o.match(/^11|^12|^13/))return $.getJSON("/api/users/search",{objectId:o},function(t){t.status||n(t.data)})},tpl_eval:function(t,e){return'
    • '+(e.avatarUrl?'':"")+e.name+"   @"+e.slug+"
    • "}}}),"news"===e.mod||"article"===e.mod||"grapevineDetail"===e.mod?e.box.on("click",".btn-group-menu a",function(){var t=$(this).data("sort"),n=$(this).text();e.sort!=t&&(e.sort=t,e.page=1,e.replyPage={},e.box.find(".comments-sort-text").text(n),e.fetch()),$(this).addClass("active"),$(this).siblings().removeClass("active")}):e.box.on("click",".dropdown-menu a",function(){var t=$(this).data("sort"),n=$(this).text();e.sort!=t&&(e.sort=t,e.page=1,e.replyPage={},e.box.find(".comments-sort-text").text(n),e.fetch())}),e.$more.on("click","a",function(){e.$more.addClass("hide"),e.$loading.removeClass("hide"),e.fetch("more")}),e.id>0&&(e.commentBtn.on("click",function(t){t.preventDefault();var n=e.textarea.val();e.commentBtn.prop("disabled",!0),"grapevineDetail"==e.mod&&(e.mod="grapevine"),$.post("/api/"+e.mod+"/"+e.id+"/comments/add",{text:n},function(t){if(e.commentBtn.prop("disabled",!1),!t.status){t.data.comment.repliedComments=null,t.data.comment.repliedCommentCount=0;var n=t.data.total,o=t.data.comment;e.eleStatNumber.text(n+" 条评论"),e.render(o,"single"),e.textarea.val("")}})}),e.container.on("click",".reply-btn",function(t){t.preventDefault();var n=$(this),o=$(this).closest(".comments-item"),i=n.closest(".reply-list"),r=o.find("textarea"),a=o.find(".reply-item--ops"),s=o.data("id"),l=o.find(".reply-text").val(),c="/api/comment/"+s+"/reply";n.prop("disabled",!0),$.post(c,{text:l},function(t){if(n.prop("disabled",!1),!t.status){i.find(".reply-more").remove();var o=t.data;o.authorId=e.authorId;var s=t.data.total;e.eleStatNumber.text(s+" 条评论");var l=e.singleComment,c=_.template(l)(o);a.before(c),r.last().val("")}})}),e.showCommentTextarea=function(t){var n=t.closest(".comments-content").find(".reply-list");$(".reply-list--empty").hide(),n.hasClass("reply-list--empty")&&n.show(),$(".reply-form").remove(),$(".reply-inner-btn").removeClass("hide"),$(".reply-item--ops").removeClass("hide");var o={};o.id=t.closest(".comments-item").data("id");var i=_.template(e.subTpl)(o);n.append(i),n.find(".reply-inner-btn").addClass("hide"),n.find(".reply-item--ops").addClass("hide"),n.find("textarea").focus(),$("textarea").autosize(),$(".reply-text").atwho({at:"@",callbacks:{remote_filter:function(t,n){var o=void 0;if(o=e.box.data("id")+"",t){if(t)return $.getJSON("/api/users/search",{q:t},function(t){t.status||n(t.data)})}else if(o.match(/^11|^12|^13/))return $.getJSON("/api/users/search",{objectId:o},function(t){t.status||n(t.data)})},tpl_eval:function(t,e){return'
    • '+(e.avatarUrl?'':"")+e.name+"   @"+e.slug+"
    • "}}})},e.container.on("click",".comments-reply-btn",function(){e.showCommentTextarea($(this))}),e.container.on("click",".comments-reply-user-btn",function(){e.showCommentTextarea($(this));var t=$(this).data("username"),n=$(this).data("userslug");$(this).closest(".reply-list").find("textarea").val("@"+t+"["+n+"] ")}),e.container.on("click",".comment-edit-btn",function(t){var e=$(this).closest(".reply-item").length>0?"reply":"comments",n=$(this).closest("."+e+"-item"),o=n.data("id"),i=n.find("."+e+"-item").height(),r=("reply"==e?n.find(".reply-content"):n.find(".comments-content .fmt")).addClass("hidden"),a=n.find(".editBtns").first().removeClass("hidden"),s=a.find(".cancel").first(),l=a.find(".edit").first(),c=n.find(".comment-edit-btn").first().addClass("hidden"),u=n.find(".editTextarea").first().css("height",i).removeClass("hidden").autosize().focus();n.find("."+e+"-content p").first().addClass("hidden"),"comments"==e?n.find(".comment-option").addClass("hidden"):n.find(".commentTools").addClass("hidden"),u.on("keydown",function(t){return(t.ctrlKey||t.metaKey)&&13===t.keyCode?($(this).siblings(".comment-func").find("button.edit").click(),!1):27===t.keyCode?($(this).siblings(".comment-func").find("button.cancel").click(),!1):9===t.keyCode?($(this).siblings(".comment-func").find("button.edit").focus(),!1):void 0}),s.click(function(){return u.addClass("hidden"),a.addClass("hidden"),r.removeClass("hidden"),c.removeClass("hidden"),n.find("."+e+"-content p").first().removeClass("hidden"),n.find(".commentTools").removeClass("hidden"),n.find(".comment-option").removeClass("hidden"),n.find(".editTextarea").removeClass("error"),n.find(".error--msg").remove(),!1}).on("keydown",function(t){if(9===t.keyCode)return $(this).parent().siblings(".commentDel").focus(),n.find(".commentTools").removeClass("hidden"),n.find(".comment-option").removeClass("hidden"),!1}),l.unbind("click").click(function(t){t.preventDefault(),$.post("/api/comment/"+o+"/edit",{text:u.val()},function(t){0===t.status&&(r.html(t.data.parsedText),n.find(".createdDate").text(t.data.createdDate),s.click(),n.find(".commentTools").removeClass("hidden"),n.find(".comment-option").removeClass("hidden"),n.find("."+e+"-content p").first().removeClass("hidden"))})}).on("keydown",function(t){if(9===t.keyCode)return $(this).siblings("button.cancel").focus(),!1})}),e.container.on("click",".comment-delete-btn",function(){var t=$(this).closest(".reply-item");t.length||(t=$(this).closest(".comments-item"));var n=t.data("id");confirm("真的要删除该评论?")&&$.post("/api/comment/"+n+"/delete",function(t){if(t.status){if("form"!==t.data[0])return sfModal({title:t.data[0],content:t.data[1]})}else e.fetch()})}),e.container.on("click",".reply-inner-btn",function(){e.showCommentTextarea($(this))}),e.container.on("click",".reply-more-btn:not(.disabled)",function(){var t=$(this),n=$(this).closest(".reply-more"),o=$(this).closest(".reply-item--ops"),i=$(this).closest(".comments-item").data("id");e.replyPage[i]=e.replyPage[i]||0;var r=++e.replyPage[i],a="/api/comment/"+i+"/more?page="+r;t.addClass("disabled"),$.get(a,function(i){if(t.removeClass("disabled"),!i.status){var r=i.data,a=e.singleComment,s=_.reduce(r.row,function(t,n){return t+_.template(a)({comment:n,authorId:e.authorId})},"");o.before(s),r.hasMore||n.remove()}})}),e.container.on("click",".comments-zan",function(t){t.preventDefault();var e=$(this),n=$(this).closest(".reply-item");0==n.length&&(n=$(this).closest(".comments-item"));var o=n.data("id"),i=e.hasClass("comments-zan--active")?"/cancel":"",r=!(0==e.parents(".not-reply").length);$.post("/api/comment/"+o+"/like"+i,function(t){if(!t.status){var n=t.data;i?(e.find(".comments-zan-text").text("赞"),e.removeClass("comments-zan--active")):(e.find(".comments-zan-text").text("已赞"),e.addClass("comments-zan--active")),r?n>0?e.find(".comments-zan-value").text("+"+n):e.find(".comments-zan-value").text(""):(e.find(".comments-zan-value").text(n),e.find(".comments-zan-value").text()>0&&(e.find(".comments-zan-value").removeClass("comment-showhide"),e.find(".fa-thumbs-up").removeClass("comment-showhide")))}})}))},this.init()}}),define("bookmark",["jquery","sfModal","main","jquery_tmpl"],function(t,e,n){"use strict";var o,i;return o='
      — 公开后不可再设置为私密
      — 仅自己可见
      ',i='

      添加到收藏夹

        {{each list}}
      • ${name}{{if ~~isPrivate}}私密{{/if}}
      • {{/each}}
      ',{createArchive:function(n,i,r){var a;a=this,e({title:"创建收藏夹",content:t.tmpl(o,{name:"",description:"",isPrivate:!0}),doneText:"提交",doneFn:function(){var e;e=t(".bookmarklist-form"),t.post("/api/bookmarkArchives/add",{name:e.find("[name=name]").val(),description:e.find("[name=description]").val(),isPrivate:e.find("[name=isPrivate]:checked").val()},function(t){0===t.status&&("edit"===i?a.editBookmark(n,r):"bookmark"===i?a.addBookmark(n,r,t.data.id):"other"===i?r(t):window.location.reload())})},hide:function(){"edit"===i?a.editBookmark(n,r):"bookmark"===i&&a.addBookmark(n,r)}})},editArchive:function(n){e({title:"编辑收藏夹",$content:t.tmpl(o,{name:n.data("name"),description:n.data("desc"),isPrivate:n.data("isprivate")}),doneText:"提交",doneFn:function(){var e;e=t(".bookmarklist-form"),t.post("/api/bookmarkArchive/"+n.data("id")+"/edit",{name:e.find("[name=name]").val(),description:e.find("[name=description]").val(),isPrivate:e.find("[name=isPrivate]:checked").val()},function(t){0===t.status&&window.location.reload()})}})},deleteArchive:function(n){e({title:"删除收藏夹",content:'确认要删除收藏夹「」么?
      注意:收藏夹下的收藏也会被删除!',doneText:"删除",doneClass:"btn-danger",closeText:"取消",show:function(){t(".fuckXss").text(n.data("name"))},doneFn:function(){t.post("/api/bookmarkArchive/"+n.data("id")+"/delete",function(t){t.status||(location.href=t.data)})}})},addBookmark:function(t,e,n){this.getArchive(t,e,"bookmark",n)},editBookmark:function(t,e){this.getArchive(t,e,"edit")},successFn:null,getArchive:function(n,o,r,a){var s;s=this,s.successFn=o,t.get("/api/user/bookmarkArchives",{objectId:n.data("id")},function(l){var c;c="",0===l.status&&(e({title:"收藏",content:t.tmpl(i),doneText:"提交",show:function(){return setTimeout(function(){var e;if(e=t(".sfmodal input[type=checkbox]").length,1===e&&!l.data[0].isBookmarked)return t(".sfmodal input[type=checkbox]").trigger("click")},100)},doneFn:function(){var i,r,a;r=t(this),t(".bookmarklist").removeClass("error").siblings(".error--msg").remove(),a=[],i=t(".bookmarklist-form").length>1?t(".bookmarklist-form").eq(1):t(".bookmarklist-form"),i.find("li.active").each(function(){a.push(t(this).data("id"))}),t(".sfmodal").find(".done-btn").text("加载中").attr("disabled","disabled"),t.post("/api/"+n.data("type")+"/"+n.data("id")+"/bookmark",{archiveIds:a},function(n){var i;0===n.status?("false"===n.data&&window.location.reload(),o&&o(n,a.length),e("hide"),i=location.pathname.split("/"),"bookmark"===i[1]&&a.indexOf(i[2])===-1&&location.reload()):(t(".bookmarklist").addClass("error").after('必须选择收藏夹'),t(".sfmodal").find(".done-btn").text("提交").removeAttr("disabled"))})}}),t(".sfModal-content").html(t.tmpl(i,[{list:l.data}])),t(".bookmarklist").delegate("li","click",function(){var e;e=t(this).find("input[type=checkbox]"),t(this).toggleClass("active"),t(this).hasClass("active")?e.prop("checked",!0):e.prop("checked",!1)}),a&&t(".bookmarklist li[data-id="+a+"]").click(),t(".sfmodal .new-bookmark").click(function(){return s.createArchive(n,r,o),!1}))})},deleteBookmark:function(n){e({title:"删除收藏",content:'确认要从收藏夹「」中删除收藏「」么?',doneText:"删除",doneClass:"btn-danger",closeText:"取消",show:function(){t(".delete-archivemodal").text(n.data("archive")),t(".delete-bookmarkmodal").text(n.data("title"))},doneFn:function(){t.post("/api/"+n.data("type")+"/"+n.data("id")+"/bookmark",{archiveId:null},function(t){0===t.status&&(n.parents(".stream-list__item").fadeOut().remove(), e("hide"))})}})}}}),define("statusToggle",[],function(){"use strict";return function(t){t.data("toggle","false"),t.data("toggle")&&(t.on("active",function(e,n){t.data("toggle","true"),n.call(this)}),t.on("unactive",function(e,n){t.data("toggle","true"),n.call(this)}))}}),!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("sf_share",e):"object"==typeof exports?exports.WidgetShare=e():t.WidgetShare=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return t[o].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";var o=n(4);t.exports=o},function(t,e){"use strict";function n(){}function o(t,e){var n;return this.element=document.querySelector(t),this.el={head:document.getElementsByTagName("head")[0],body:document.getElementsByTagName("body")[0]},this.config={enabled_networks:0,protocol:-1===["http","https"].indexOf(window.location.href.split(":")[0])?"https://":"//",url:$(t).parent().data("url")||location.href,text:this.data(this.element,"text"),caption:null,title:this.data(this.element,"text")?this.data(this.element,"text"):(n=document.querySelector('meta[property="og:title"]')||document.querySelector('meta[name="twitter:title"]'))?n.getAttribute("content"):(n=document.querySelector("title"))?n.innerText:void 0,image:this.data(this.element,"image")||"http://s.segmentfault.com/img/sf-114.png",pic:this.data(this.element,"pic")||"http://static.segmentfault.com/global/img/touch-icon.png",description:(n=document.querySelector('meta[property="og:description"]')||document.querySelector('meta[name="twitter:description"]')||document.querySelector('meta[name="description"]'))?n.getAttribute("content"):"",networks:{weibo:{enabled:!0,url:null,title:null,text:null,caption:null,description:null,image:null,pic:null,appkey:"1742025894"},wechart:{enabled:!0,url:null},renren:{enabled:!0,url:null,title:null,text:null,description:null,image:null,comment:null},tqq:{enabled:!0,url:null,appkey:"",title:null,text:null,image:null},douban:{enabled:!0,url:null,href:null,appkey:null,text:null,title:null,caption:null,description:null,image:null,comment:null},google_plus:{enabled:!1,url:null},twitter:{enabled:!0,url:null,text:null,description:null},facebook:{enabled:!0,load_sdk:!0,url:null,app_id:null,title:null,caption:null,description:null,image:null},pinterest:{enabled:!1,url:null,image:null,description:null},email:{enabled:!1,title:null,description:null}}},this.setup(t,e),this}"classList"in document.documentElement||!Object.defineProperty||"undefined"==typeof HTMLElement||Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){var t,e,n;return n=function(t){return function(n){var o,i;o=e.className.split(/\s+/),i=o.indexOf(n),t(o,i,n),e.className=o.join(" ")}},e=this,t={add:n(function(t,e,n){~e||t.push(n)}),remove:n(function(t,e){~e&&t.splice(e,1)}),toggle:n(function(t,e,n){~e?t.splice(e,1):t.push(n)}),contains:function(t){return!!~e.className.split(/\s+/).indexOf(t)},item:function(t){return e.className.split(/\s+/)[t]||null}},Object.defineProperty(t,"length",{get:function(){return e.className.split(/\s+/).length}}),t}});var i={}.hasOwnProperty,r=function(t,e){function n(){this.constructor=t}for(var o in e)i.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};n.prototype.extend=function(t,e,n){var o,i;for(i in e)o=void 0!==t[i],o&&"object"==typeof e[i]?this.extend(t[i],e[i],n):(n||!o)&&(t[i]=e[i])},n.prototype.hide=function(t){return t.style.display="none"},n.prototype.show=function(t){return t.style.display="block"},n.prototype.has_class=function(t,e){return t.classList.contains(e)},n.prototype.add_class=function(t,e){return t.classList.add(e)},n.prototype.remove_class=function(t,e){return t.classList.remove(e)},n.prototype.is_encoded=function(t){return t?(t=t.replace(/\%/g,""),decodeURIComponent(t)!==t):void 0},n.prototype.encode=function(t){return this.is_encoded(t)?t:encodeURIComponent(t)},n.prototype.data=function(t,e){return t?t.getAttribute("data-"+e):void 0},n.prototype.popover=function(t){var e=document.createElement("div");e.innerHTML='',document.body.appendChild(e),$("#shareQrcode").qrcode({width:300,height:300,text:t});var n=document.getElementsByClassName("share-modal")[0],o=document.getElementsByClassName("share-modal-close")[0];o.onclick=function(){n.parentNode.removeChild(n),o.onclick=null}},n.prototype.popup=function(t,e){var n,o,i,r;return null==e&&(e={}),o={width:500,height:350},o.top=screen.height/2-o.height/2,o.left=screen.width/2-o.width/2,i=function(){var t;t=[];for(n in e)r=e[n],t.push(n+"="+this.encode(r));return t}.call(this).join("&"),i&&(i="?"+i),window.open(t+i,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=550,height=500")},r(o,n),o.prototype.setup=function(t,e){var n,o,i,r,a;for(i=document.querySelectorAll(t),this.extend(this.config,e,!0),this.set_global_configuration(),this.normalize_network_configuration(),n=r=0,a=i.length;a>r;n=++r)o=i[n],this.setup_instance(t,n);this.config.callback()},o.prototype.setup_instance=function(t,e){var n,o,i,r,a,s,l;for(n=document.querySelectorAll(t)[e],this.hide(n),this.add_class(n,"sharer-"+e),this.inject_html(n),this.show(n),i=n.getElementsByTagName("li"),l=this,s=[],e=r=0,a=i.length;a>r;e=++r)o=i[e],s.push(o.addEventListener("click",function(){return l.event_network(n,this)}));return s},o.prototype.event_network=function(t,e){var n;return n=e.getAttribute("data-network"),this["network_"+n]()},o.prototype.public=function(t){var e,n,o,i,r,a,s;for(a=document.querySelectorAll(this.element),s=[],n=i=0,r=a.length;r>i;n=++i)o=a[n],e=o.getElementsByClassName("social")[0],s.push(this["event_"+t](e));return s},o.prototype.network_facebook=function(){return this.config.networks.facebook.load_sdk?window.FB?FB.ui({method:"feed",name:this.config.networks.facebook.title,link:this.config.networks.facebook.url,picture:this.config.networks.facebook.image,caption:this.config.networks.facebook.caption,description:this.config.networks.facebook.description}):console.error("The Facebook JS SDK hasn't loaded yet."):this.popup("https://www.facebook.com/sharer/sharer.php",{u:this.config.networks.facebook.url})},o.prototype.network_twitter=function(){return this.popup("https://twitter.com/intent/tweet",{text:this.config.networks.twitter.text,url:this.config.networks.twitter.url+"?utm_source=Twitter&utm_medium=shareLink&utm_campaign=socialShare"})},o.prototype.network_google_plus=function(){return this.popup("https://plus.google.com/share",{url:this.config.networks.google_plus.url})},o.prototype.network_pinterest=function(){return this.popup("https://www.pinterest.com/pin/create/button",{url:this.config.networks.pinterest.url,media:this.config.networks.pinterest.image,description:this.config.networks.pinterest.description})},o.prototype.network_email=function(){return this.popup("mailto:",{subject:this.config.networks.email.title,body:this.config.networks.email.description})},o.prototype.network_weibo=function(){var t="";return t=-1!==this.config.networks.weibo.url.indexOf("?")?this.config.networks.weibo.url+"&utm_source=Weibo&utm_medium=shareLink&utm_campaign=socialShare":this.config.networks.weibo.url+"?utm_source=Weibo&utm_medium=shareLink&utm_campaign=socialShare",this.popup("http://service.weibo.com/share/share.php",{title:this.config.networks.weibo.title.replace(/"/g,"%2522"),url:t,pic:this.config.networks.weibo.image,appkey:this.config.networks.weibo.appkey,searchPic:"false"})},o.prototype.network_wechart=function(){return this.popover(this.config.networks.wechart.url+"?utm_source=Wechat&utm_medium=shareLink&utm_campaign=socialShare")},o.prototype.network_renren=function(){return this.popup("http://widget.renren.com/dialog/share",{resourceUrl:this.config.networks.renren.image,pic:this.config.networks.renren.image,srcUrl:this.config.networks.renren.url+"?utm_source=Renren&utm_medium=shareLink&utm_campaign=socialShare",title:this.config.networks.renren.title,description:this.config.networks.renren.description,comment:this.config.networks.renren.comment||""})},o.prototype.network_tqq=function(){return this.popup("http://share.v.t.qq.com/index.php",{c:"share",a:"index",url:this.config.networks.tqq.url+"?utm_source=Tqq&utm_medium=shareLink&utm_campaign=socialShare",title:this.config.networks.tqq.title,appkey:this.config.networks.tqq.appkey,pic:this.config.networks.tqq.image})},o.prototype.network_douban=function(){return this.popup("http://www.douban.com/share/service",{href:this.config.networks.douban.url+"?utm_source=Douban&utm_medium=shareLink&utm_campaign=socialShare",name:this.config.networks.douban.title,image:this.config.networks.douban.image,text:this.config.networks.douban.description,comment:this.config.networks.douban.comment||""})},o.prototype.inject_html=function(t){t.innerHTML=''},o.prototype.hook=function(t,e,n){var o,i;o=this.config.networks[e][t],"function"==typeof o&&(i=o.call(this.config.networks[e],n),void 0!==i&&(i=this.normalize_filter_config_updates(i),this.extend(this.config.networks[e],i,!0),this.normalize_network_configuration()))},o.prototype.set_global_configuration=function(){var t,e,n,o,i,r;for(n in o)n||(this.config[n]=o[n]);i=this.config.networks,r=[];for(e in i){o=i[e];for(n in o)null==this.config.networks[e][n]&&(this.config.networks[e][n]=this.config[n]);this.config.networks[e].enabled?(t="block",this.config.enabled_networks+=1):t="none",r.push(this.config.networks[e].display=t)}return r},o.prototype.normalize_network_configuration=function(){return this.config.networks.facebook.app_id||(this.config.networks.facebook.load_sdk=!1),this.is_encoded(this.config.networks.twitter.description)||(this.config.networks.twitter.description=encodeURIComponent(this.config.networks.twitter.description)),"number"==typeof this.config.networks.facebook.app_id?this.config.networks.facebook.app_id=this.config.networks.facebook.app_id.toString():void 0},o.prototype.normalize_filter_config_updates=function(t){return this.config.networks.facebook.app_id!==t.app_id&&(console.warn("You are unable to change the Facebook app_id after the button has been initialized. Please update your Facebook filters accordingly."),delete t.app_id),this.config.networks.facebook.load_sdk!==t.load_sdk&&(console.warn("You are unable to change the Facebook load_sdk option after the button has been initialized. Please update your Facebook filters accordingly."),delete t.app_id),t},t.exports=o},function(t,e){"use strict";function n(t,e){this.setup(t,e)}n.prototype={constructor:n,setup:function(t,e){this.initAttr(t,e),this.initDom()},initAttr:function(t,e){this.element=$(t),this.options=$.extend({url:this.element.data("url"),shorturl:this.element.data("shorturl"),widgetScript:this.element.data("widgetscript")},e)},initDom:function(){var t=this.options.url,e=this.options.shorturl,n=this.options.widgetScript,o='
      '.replace(/{{url}}/g,t).replace(/{{shorturl}}/g,e);n&&(o+='

      将以上代码粘贴到其它支持嵌入 <script> 标签的网站

      ');var i=this.element.find(".icon-sn-dotted");i.popover({html:!0,placement:"top",trigger:"manual",container:"body",content:o}),i.click(function(){$(this).popover("toggle")}),$("body").on("click",function(t){$(t.target).parents(".popover").length||t.target===i[0]||i.popover("hide")}),i.on("shown.bs.popover",function(){"undefined"===e&&$('[data-share-target="shorturl"]').hide(),$(".shareUrl, .shareWidgetScript").on("mouseenter",function(t){$(this).find("input").select()}),$(".shareWidgetScript input").val(n),$(".shareWidgetScript .copyUrl").data("clipboard-text",n),$(".shareUrl .copyWidgetScript").data("clipboard-text",t),$(".shareUrl [data-share-target]").click(function(n){var o=$(".shareUrl input");o.val()===t?(o.val(e),$(this).text("还原")):(o.val(t),$(this).text("缩短"))}),$('[data-toggle="tooltip"]').tooltip();var o=$(".copy");o.mouseout(function(){o.attr("title",""),o.attr("data-original-title","")}),o.click(function(t){try{$(this).parents(".input-group").find("input").select(),document.execCommand("copy"),$(this).attr("title","已复制").attr("data-original-title","已复制").tooltip("show")}catch(t){$(this).attr("title","无法复制!").attr("data-original-title","无法复制!").tooltip("show")}})})},destroy:function(){this.element.off().remove()}},t.exports=n},function(t,e,n){"use strict";function o(t,e,n){this.setup(t,e,n)}var i=n(3),r=n(2);o.prototype={constructor:o,setup:function(t,e,n){return this.initAttr(t,e),n?(this.initDom(),this.initShareMore(),void this.initNetwork()):void this.initNetwork(t)},initAttr:function(t,e){this.element=$(t),this.options=$.extend({url:this.element.data("url"),shorturl:this.element.data("shorturl"),title:this.element.data("title"),text:this.element.data("text"),image:this.element.data("image"),widgetScript:this.element.data("widgetscript")},e)},initDom:function(){var t=this.options.url,e=this.options.shorturl,n=this.options.widgetScript,o='
      分享扩散:
      •••'.replace(/{{url}}/g,t).replace(/{{shorturl}}/g,e);this.element.html(o),this.element.find(".shareMore").data("widgetscript",n)},initShareMore:function(){this.more=new i(".shareMore")},initNetwork:function(t){this.network=new r(t||".widget-share-network",{image:this.options.image,title:this.options.title,text:this.options.text,callback:function(){$((t||".widget-share-network")+" .sn-inline a").tooltip()},networks:this.options.networks||{}})},destroy:function(){this.element.empty(),this.switchUrl&&this.switchUrl.destroy(),this.network.destroy()}},t.exports=o}])}),define("math",["jquery","main"],function(t,e){"use strict";return function(n){var o,i;o=n||t(".fmt"),"undefined"!=typeof MathJax?o.each(function(){MathJax.Hub.Queue(["Typeset",MathJax.Hub,this])}):(i=e.staticUrl+"/3rd/MathJax/MathJax.js",t.getScript(i,function(){MathJax.Hub.Config({extensions:["tex2jax.js"],jax:["input/TeX","output/HTML-CSS"],tex2jax:{inlineMath:[["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,ignoreClass:"side"},skipStartupTypeset:!0,showProcessingMessages:!1}),o.each(function(){MathJax.Hub.Queue(["Typeset",MathJax.Hub,this])})}))}}),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define("Clipboard",[],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){var t;return function t(e,n,o){function i(a,s){if(!n[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(r)return r(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n?n:t)},u,u.exports,t,e,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a'),e.remove()},u=/((?:0\u20E3|1\u20E3|2\u20E3|3\u20E3|4\u20E3|5\u20E3|6\u20E3|7\u20E3|8\u20E3|9\u20E3|#\u20E3|\*\u20E3|\uD83C(?:\uDDE6\uD83C(?:\uDDE8|\uDDE9|\uDDEA|\uDDEB|\uDDEC|\uDDEE|\uDDF1|\uDDF2|\uDDF4|\uDDF6|\uDDF7|\uDDF8|\uDDF9|\uDDFA|\uDDFC|\uDDFD|\uDDFF)|\uDDE7\uD83C(?:\uDDE6|\uDDE7|\uDDE9|\uDDEA|\uDDEB|\uDDEC|\uDDED|\uDDEE|\uDDEF|\uDDF1|\uDDF2|\uDDF3|\uDDF4|\uDDF6|\uDDF7|\uDDF8|\uDDF9|\uDDFB|\uDDFC|\uDDFE|\uDDFF)|\uDDE8\uD83C(?:\uDDE6|\uDDE8|\uDDE9|\uDDEB|\uDDEC|\uDDED|\uDDEE|\uDDF0|\uDDF1|\uDDF2|\uDDF3|\uDDF4|\uDDF5|\uDDF7|\uDDFA|\uDDFB|\uDDFC|\uDDFD|\uDDFE|\uDDFF)|\uDDE9\uD83C(?:\uDDEA|\uDDEC|\uDDEF|\uDDF0|\uDDF2|\uDDF4|\uDDFF)|\uDDEA\uD83C(?:\uDDE6|\uDDE8|\uDDEA|\uDDEC|\uDDED|\uDDF7|\uDDF8|\uDDF9|\uDDFA)|\uDDEB\uD83C(?:\uDDEE|\uDDEF|\uDDF0|\uDDF2|\uDDF4|\uDDF7)|\uDDEC\uD83C(?:\uDDE6|\uDDE7|\uDDE9|\uDDEA|\uDDEB|\uDDEC|\uDDED|\uDDEE|\uDDF1|\uDDF2|\uDDF3|\uDDF5|\uDDF6|\uDDF7|\uDDF8|\uDDF9|\uDDFA|\uDDFC|\uDDFE)|\uDDED\uD83C(?:\uDDF0|\uDDF2|\uDDF3|\uDDF7|\uDDF9|\uDDFA)|\uDDEE\uD83C(?:\uDDE8|\uDDE9|\uDDEA|\uDDF1|\uDDF2|\uDDF3|\uDDF4|\uDDF6|\uDDF7|\uDDF8|\uDDF9)|\uDDEF\uD83C(?:\uDDEA|\uDDF2|\uDDF4|\uDDF5)|\uDDF0\uD83C(?:\uDDEA|\uDDEC|\uDDED|\uDDEE|\uDDF2|\uDDF3|\uDDF5|\uDDF7|\uDDFC|\uDDFE|\uDDFF)|\uDDF1\uD83C(?:\uDDE6|\uDDE7|\uDDE8|\uDDEE|\uDDF0|\uDDF7|\uDDF8|\uDDF9|\uDDFA|\uDDFB|\uDDFE)|\uDDF2\uD83C(?:\uDDE6|\uDDE8|\uDDE9|\uDDEA|\uDDEB|\uDDEC|\uDDED|\uDDF0|\uDDF1|\uDDF2|\uDDF3|\uDDF4|\uDDF5|\uDDF6|\uDDF7|\uDDF8|\uDDF9|\uDDFA|\uDDFB|\uDDFC|\uDDFD|\uDDFE|\uDDFF)|\uDDF3\uD83C(?:\uDDE6|\uDDE8|\uDDEA|\uDDEB|\uDDEC|\uDDEE|\uDDF1|\uDDF4|\uDDF5|\uDDF7|\uDDFA|\uDDFF)|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C(?:\uDDE6|\uDDEA|\uDDEB|\uDDEC|\uDDED|\uDDF0|\uDDF1|\uDDF2|\uDDF3|\uDDF7|\uDDF8|\uDDF9|\uDDFC|\uDDFE)|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C(?:\uDDEA|\uDDF4|\uDDF8|\uDDFA|\uDDFC)|\uDDF8\uD83C(?:\uDDE6|\uDDE7|\uDDE8|\uDDE9|\uDDEA|\uDDEC|\uDDED|\uDDEE|\uDDEF|\uDDF0|\uDDF1|\uDDF2|\uDDF3|\uDDF4|\uDDF7|\uDDF8|\uDDF9|\uDDFB|\uDDFD|\uDDFE|\uDDFF)|\uDDF9\uD83C(?:\uDDE6|\uDDE8|\uDDE9|\uDDEB|\uDDEC|\uDDED|\uDDEF|\uDDF0|\uDDF1|\uDDF2|\uDDF3|\uDDF4|\uDDF7|\uDDF9|\uDDFB|\uDDFC|\uDDFF)|\uDDFA\uD83C(?:\uDDE6|\uDDEC|\uDDF2|\uDDF8|\uDDFE|\uDDFF)|\uDDFB\uD83C(?:\uDDE6|\uDDE8|\uDDEA|\uDDEC|\uDDEE|\uDDF3|\uDDFA)|\uDDFC\uD83C(?:\uDDEB|\uDDF8)|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C(?:\uDDEA|\uDDF9)|\uDDFF\uD83C(?:\uDDE6|\uDDF2|\uDDFC)))|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2694\u2696\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD79\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED0\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3]|\uD83E[\uDD10-\uDD18\uDD80-\uDD84\uDDC0])/g,a?(a.find("h1, h2, h3, strong").each(function(){return $(this).html($(this).html().replace(u,'$1'))}),a.find("span.emoji").each(function(){return d($(this))})):($("h1, h2, h3, strong").each(function(){return $(this).html($(this).html().replace(u,'$1'))}),$("span.emoji").each(function(){return d($(this))})),h=function(t){var e,n,o,i;return e=document,i=t.get(0),e.body.createTextRange?(n=e.body.createTextRange(),n.moveToElementText(i),n.select()):window.getSelection?(o=window.getSelection(),n=e.createRange(),n.selectNodeContents(i),o.removeAllRanges(),o.addRange(n)):void 0},c=function(t){var e,o,i,r;r='\n \n ',i=$(r),t.before(i),$('[data-toggle="tooltip"]').tooltip({container:"body"}),o=i.find(".copyCode"),e=t.children("code"),t.hoverIntent({interval:50,over:function(){i.show()},out:function(){i.is(":hover")||i.hide()}}),i.hoverIntent({interval:50,over:function(){},out:function(){t.is(":hover")||i.hide()}}),i.find(".selectCode").click(function(){return h(e)}),o.attr("data-clipboard-text",e.text());var a=new n(".copyCode");a.on("success",function(t){$(".copyCode").attr("data-original-title","复制"),$(t.trigger).attr("data-original-title","已复制").tooltip("show"),t.clearSelection()}),a.on("error",function(t){$(t.trigger).prev().trigger("click"),$(".copyCode").attr("data-original-title","复制"),$(t.trigger).attr("data-original-title","按 ⌘+c 复制").tooltip("show")})},p=function(t){var e,n,o,s,l,u,p,d,h,f,m,g;f=t,u={actionscript:/^as[1-3]$/i,cmake:/^(make|makefile)$/i,cs:/^csharp$/i,typescript:/^ts$/i,css:/^css[1-3]$/i,javascript:/^js$/i,markdown:/^md$/i,objectivec:/^(oc|objective-c)$/i,php:/^php[1-6]$/i,sql:/^mysql$/i,xml:/^(html|html5|xhtml)$/i,flow:/^flow$/i,sequence:/^sequence$/i},s=void 0,l=["objectivec","lisp","scala","typescript","groovy","sql","actionscript","xml","markdown","perl","java","bash","shell","clojure","kotlin","fortran","lua","swift","json","nginx","ini","css","javascript","makefile","ruby","basic","cs","coffeescript","go","php","erlang","cpp","haskell","properties","diff","apache","dart","rust","cmake","r","python"],o=void 0,e=void 0,h=!1,g=!1,2===f.children("code").length?(e=f.children("code").first().text(),f.children("code").first().remove(),o=f.children("code").addClass(e)):(o=f.children("code"),1===o.text().split("\n").length&&o.css({"word-break":"break-word","white-space":"initial"}),e=o.attr("class")),e&&(n=e.split(/\s+/),n.indexOf("nohighlight")!==-1&&(h=!0),n.forEach(function(t){var e,n;if(n=t.toLowerCase(),l.indexOf(n)!==-1)s=n;else for(e in u)n.match(u[e])&&(s=e)}),s&&f.attr("class",s)),s&&("flow"===s?(d=$(".flowChart").length,o.parent().after('
      '),r("flow",[o.text(),"flowDiagram"+d]),o.parent().remove(),g=!0):"sequence"===s&&(a=o.parent(),m=o.text(),d=$(".sequenceChart").length,a.replaceWith('
      '+m+"
      "),r("sequence",$("#sequenceDiagram"+d)),g=!0)),h||g||(p=f.html(),p.length<1e4&&i(f[0])),c(f)},a?(l=s(a.text()),l&&e(a),a.find("pre").each(function(){p($(this))})):($(".fmt").each(function(){var t=$(this);s(t.text())&&e(t)}),$(".fmt pre").each(function(){p($(this))}))}}),function(t){t.fn.qrcode=function(e){function n(t){this.mode=s,this.data=t}function o(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function i(t,e){if(void 0==t.length)throw Error(t.length+"/"+e);for(var n=0;nt||this.moduleCount<=t||0>e||this.moduleCount<=e)throw Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var t=1,t=1;40>t;t++){for(var e=r.getRSBlocks(t,this.errorCorrectLevel),n=new a,o=0,i=0;i=n;n++)if(!(-1>=t+n||this.moduleCount<=t+n))for(var o=-1;7>=o;o++)-1>=e+o||this.moduleCount<=e+o||(this.modules[t+n][e+o]=0<=n&&6>=n&&(0==o||6==o)||0<=o&&6>=o&&(0==n||6==n)||2<=n&&4>=n&&2<=o&&4>=o)},getBestMaskPattern:function(){for(var t=0,e=0,n=0;8>n;n++){this.makeImpl(!0,n);var o=l.getLostPoint(this);(0==n||t>o)&&(t=o,e=n)}return e},createMovieClip:function(t,e,n){for(t=t.createEmptyMovieClip(e,n),this.make(),e=0;e=r;r++)for(var a=-2;2>=a;a++)this.modules[o+r][i+a]=-2==r||2==r||-2==a||2==a||0==r&&0==a}},setupTypeNumber:function(t){for(var e=l.getBCHTypeNumber(this.typeNumber),n=0;18>n;n++){var o=!t&&1==(e>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=o}for(n=0;18>n;n++)o=!t&&1==(e>>n&1),this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=o},setupTypeInfo:function(t,e){for(var n=l.getBCHTypeInfo(this.errorCorrectLevel<<3|e),o=0;15>o;o++){var i=!t&&1==(n>>o&1);6>o?this.modules[o][8]=i:8>o?this.modules[o+1][8]=i:this.modules[this.moduleCount-15+o][8]=i}for(o=0;15>o;o++)i=!t&&1==(n>>o&1),8>o?this.modules[8][this.moduleCount-o-1]=i:9>o?this.modules[8][15-o-1+1]=i:this.modules[8][15-o-1]=i;this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var n=-1,o=this.moduleCount-1,i=7,r=0,a=this.moduleCount-1;0s;s++)if(null==this.modules[o][a-s]){var c=!1;r>>i&1)),l.getMask(e,o,a-s)&&(c=!c),this.modules[o][a-s]=c,i--,-1==i&&(r++,i=7)}if(o+=n,0>o||this.moduleCount<=o){o-=n,n=-n;break}}}},o.PAD0=236,o.PAD1=17,o.createData=function(t,e,n){for(var e=r.getRSBlocks(t,e),i=new a,s=0;s8*t)throw Error("code length overflow. ("+i.getLengthInBits()+">"+8*t+")");for(i.getLengthInBits()+4<=8*t&&i.put(0,4);0!=i.getLengthInBits()%8;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*t)&&(i.put(o.PAD0,8),!(i.getLengthInBits()>=8*t));)i.put(o.PAD1,8);return o.createBytes(i,e)},o.createBytes=function(t,e){for(var n=0,o=0,r=0,a=Array(e.length),s=Array(e.length),c=0;c>>=1;return e},getPatternPosition:function(t){return l.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,n){switch(t){case 0:return 0==(e+n)%2;case 1:return 0==e%2;case 2:return 0==n%3;case 3:return 0==(e+n)%3;case 4:return 0==(Math.floor(e/2)+Math.floor(n/3))%2;case 5:return 0==e*n%2+e*n%3;case 6:return 0==(e*n%2+e*n%3)%2;case 7:return 0==(e*n%3+(e+n)%2)%2;default:throw Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new i([1],0),n=0;ne)switch(t){case 1:return 10;case 2:return 9;case s:return 8;case 8:return 8;default:throw Error("mode:"+t)}else if(27>e)switch(t){case 1:return 12;case 2:return 11;case s:return 16;case 8:return 10;default:throw Error("mode:"+t)}else{if(!(41>e))throw Error("type:"+e);switch(t){case 1:return 14;case 2:return 13;case s:return 16;case 8:return 12;default:throw Error("mode:"+t)}}},getLostPoint:function(t){for(var e=t.getModuleCount(),n=0,o=0;o=s;s++)if(!(0>o+s||e<=o+s))for(var l=-1;1>=l;l++)0>i+l||e<=i+l||0==s&&0==l||a==t.isDark(o+s,i+l)&&r++;5t)throw Error("glog("+t+")");return c.LOG_TABLE[t]},gexp:function(t){for(;0>t;)t+=255;for(;256<=t;)t-=255;return c.EXP_TABLE[t]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)},u=0;8>u;u++)c.EXP_TABLE[u]=1<u;u++)c.EXP_TABLE[u]=c.EXP_TABLE[u-4]^c.EXP_TABLE[u-5]^c.EXP_TABLE[u-6]^c.EXP_TABLE[u-8];for(u=0;255>u;u++)c.LOG_TABLE[c.EXP_TABLE[u]]=u;return i.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=Array(this.getLength()+t.getLength()-1),n=0;nthis.getLength()-t.getLength())return this;for(var e=c.glog(this.get(0))-c.glog(t.get(0)),n=Array(this.getLength()),o=0;o>>7-t%8&1)},put:function(t,e){for(var n=0;n>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},"string"==typeof e&&(e={text:e}),e=t.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,correctLevel:2,background:"#ffffff",foreground:"#000000"},e),this.each(function(){var n;if("canvas"==e.render){n=new o(e.typeNumber,e.correctLevel),n.addData(e.text),n.make();var i=document.createElement("canvas");i.width=e.width,i.height=e.height;for(var r=i.getContext("2d"),a=e.width/n.getModuleCount(),s=e.height/n.getModuleCount(),l=0;l").css("width",e.width+"px").css("height",e.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",e.background),r=e.width/n.getModuleCount(),a=e.height/n.getModuleCount(),s=0;s").css("height",a+"px").appendTo(i),c=0;c").css("width",r+"px").css("background-color",n.isDark(s,c)?e.foreground:e.background).appendTo(l);n=i,jQuery(n).appendTo(this)})}}(jQuery),define("jquery_qrcode",["jquery"],function(t){return function(){var e;return e||t.$.fn.qrcode}}(this)),define("sf_pay",["jquery","sfModal","isMobile","pingpp","jquery_qrcode"],function(t,e,n,o){return function(i){var r=void 0;r=0===i.type?'\n \n
      \n '+(i.isDiscounted?'

      讲座价格 ¥'+i.originPrice+'

      优惠 ¥'+i.discountPrice+'

      ':"")+'\n \n 付款金额(元)\n

      \n '+i.price+'\n

      \n \n \n \n '+(i.isLive?'

      付款即表示你同意《讲堂服务协议》

      ':"")+"\n
      \n ":'\n \n
      \n

      \n 付款金额(元)\n

      \n
      \n '+i.price.toFixed(2)+'\n
      \n \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n \n \n '+(i.isLive?'

      付款即表示你同意《讲堂服务协议》

      ':"")+"\n
      \n ",e({title:i.title,modalSize:"modal-sm",$content:r,hideClose:!0,hideDone:!0,show:function(){var r=navigator.userAgent.toLowerCase();n("any")?/micromessenger/.test(r)?t(".btn--wechat").removeClass("hide"):t(".btn--alipay").removeClass("hide"):(t(".btn--alipay").removeClass("hide"),t(".btn--wechat").removeClass("hide"));var a=function(n,r){if(i.formData.paymentMethod=n,1===i.type){var a=t(".sf__pay-price-number").html().trim();i.formData.amount=a,i.formData.price=a}var s=t(".sf__pay-validate"),l=t(this);l.prop("disabled",!0),s.addClass("invisible"),t.post(i.api,i.formData,function(a){if(l.prop("disabled",!1),a.status){if("form"===a.data[0]){var c=_.reduce(a.data[1],function(t,e){return t+e+"
      "},"");s.html(c).removeClass("invisible")}}else{var u=a.data;switch(n){case"wx_pub":u.extra=r,o.createPayment(u,function(e,n){"success"==e?t.get("/api/pay/"+u.order_no+"/check",function(t){!t.status&&t.data&&(location.href=t.data)}):"fail"==e&&alert(n.msg)});break;case"wx_pub_qr":var p=u.credential?u.credential.wx_pub_qr:null,d="/pay/check?out_trade_no="+u.order_no;if(p){var h=function(){var t='\n \n
      \n
      \n

      微信扫码支付

      \n

      \n 付款成功后点此刷新\n

      \n
      ';return t};e({title:i.title,hideClose:!0,hideDone:!0,modalSize:"modal-sm",$content:h(),show:function(){t(".wx_pub_qr").qrcode({text:p,width:180,height:180});var e=setInterval(function(){t.get("/api/pay/"+u.order_no+"/check",function(t){!t.status&&t.data&&(clearInterval(e),location.href=t.data)})},5e3)}})}break;case"alipay_qr":var p=u.credential?u.credential.alipay_qr:null,d="/pay/check?out_trade_no="+u.order_no;if(p){var f=function(){var t='\n \n
      \n
      \n

      支付宝扫码支付

      \n

      \n 付款成功后点此刷新\n

      \n
      ';return t};e({title:i.title,hideClose:!0,hideDone:!0,modalSize:"modal-sm",$content:f(),show:function(){t(".wx_pub_qr").qrcode({text:p,height:180,width:180});var e=setInterval(function(){t.get("/api/pay/"+u.order_no+"/check",function(t){!t.status&&t.data&&(clearInterval(e),location.href=t.data)})},5e3)}})}break;default:o.createPayment(u,function(t,e){"success"==t||"fail"==t&&s.html("支付暂不可用 "+e.msg).removeClass("invisible")})}}})};t(".sfmodal").on("click",".sf__pay-btn--alipay",function(){if(n("any")){var t={app_pay:!0};a.call(this,"alipay_wap",t)}else a.call(this,"alipay_qr")}),t(".sfmodal").on("click",".sf__pay-btn--wechat",function(){var e=this,o="wx_pub_qr";/micromessenger/.test(r)?(o="wx_pub",t.get("/api/user/weixin/openid",function(t){if(t.data.match(/^https?/i))location.href=t.data;else{var n={open_id:t.data};a.call(e,o,n)}})):n("any")?a.call(e,o):a.call(e,o)})}}),1===i.type&&(t("body").on("click",".sf__pay-price-sample .btn",function(){var e=t(this),n=e.data("price"),o=t(".sf__pay-price-number");o.html(n),t(".sf__pay-price-sample .btn.active").removeClass("active"),e.addClass("active")}),t("body").on("focus",".sf__pay-price-number",function(){t(".sf__pay-price-sample .btn.active").removeClass("active")}),t("body").on("input",".sf__pay-price-number",function(){var e=t(this).html();isNaN(e)?t(this).html(""):Number.isInteger(Number(e))||e.split(".")[1].length>2&&t(this).html(Number(e).toFixed(2))}))}}),define("specialUrl",["jquery","jquery_tmpl"],function(t){var e,n,o,i,r,a,s,l,c,u;c=function(e,n){var o,i;o=t(".v_"+e),i=o.after(t.tmpl(l,n)).next(".video-prev"),i.click(function(){i.hide(),i.after(t.tmpl(s,n)).next(".video-body").find(".hide-video").click(function(){i.show(),t(this).parent().remove()})}),o.remove()},i=0,r=[{reg:/^https?:\/\/jsfiddle\.net\/([_a-z0-9-\/,]+)$/i,fn:function(e){e.indexOf("embedded")<0&&(e+=/\/$/.test(e)?"embedded":"/embedded"),e="https://jsfiddle.net/"+e,t('').insertAfter(this)}},{reg:/^https?:\/\/gist\.github\.com\/([_a-z0-9-\/]+)$/i,fn:function(e){var n,o,r,a,s,l,c;c="https://gist.github.com/"+e+".json?callback=special_"+i,r=t('').insertAfter(this),s=r[0],a=s.contentWindow?s.contentWindow.document:s.contentDocument?s.contentDocument:s.document,l=a.createElement("script"),o=t(a),n=t("body",o),r.ready(function(){r.height(o.height())}),s.contentWindow["special_"+i]=function(t){n.append(t.div).css({padding:0,margin:0}),o.find("head").append(''),o.find("head").append(""),setTimeout(function(){r.height(o.height())},5e3)},l.type="text/javascript",l.src=c,a.body.appendChild(l),i++}},{reg:/^https?:\/\/runjs\.cn\/detail\/([_0-9a-z-]+)$/i,fn:function(e){var n,o,i,r,a,s,l;n=function(){t("body",o).css("margin",0),t(".runjs_gist",o).css("border","none"),t(".gist_content",o).css("font-size","14px")},t("#special-runjs"+e).length>0||(l="https://runjs.cn/gist/"+e+"/all",i=t('').insertAfter(this),r=i[0],o=r.contentWindow?r.contentWindow.document:r.contentDocument?r.contentDocument:r.document, s=o.createElement("script"),a=o||o.__proto__,a.write=function(e){t(e).appendTo(o.body)},s.type="text/javascript",s.src=l,o.body.appendChild(s),s.onreadystatechange=n,s.onload=n)}},{reg:/^https?:\/\/codepen\.io\/([_a-zA-Z0-9-\/,]+)$/i,fn:function(e){e.indexOf("embed")<0&&(e=e.replace("pen","embed")),e="https://codepen.io/"+e,t('').insertAfter(this)}},{reg:/^https?:\/\/segmentfault\.com\/n\/([_a-zA-Z0-9-\/,\.]+)$/i,fn:function(e){return e="https://segmentfault.com/n/"+e+"/widget",t('').insertAfter(this),t(this).prev("a").remove()}}],l='
      ${title}
      ${link}
      ',s='',e=void 0,o=void 0,a=void 0,u=void 0;var p=!1;return n=new RegExp(window.location.host,"ig"),function(){t(".fmt a").each(function(e){var i,a,s=!1,l=t(this),i=l.attr("href"),u=/^https?:\/\//.test(i);if(!n.test(i)&&u){l.attr("target","_blank");var d=i.indexOf("?"),h=i;d>0&&(i=i.substring(0,d));var f=i.indexOf("#");if(f>0&&(i=i.substring(0,f)),t.each(r,function(t,e){s||(o=i.match(e.reg),o&&(l.after(''),s=!0))}),!s)if(!p&&i.match(/\.(mp3|m3u)$/i)){var m=t('
      "},b=function(t){return''},g=function(t,e){return $.ajax({type:"get",url:"/api/question/search",async:!0,data:{q:t},dataType:"json",success:function(t){var n;return"login"===t.data[0]?void r.modal("hide"):(n=y(t.data,x),void e.html(n))}})},f={subReason:function(t){var e;return e=$(v(t)),o.append(e),e},duplicate:function(t){var n,i,r,a,s={value:t};return a=$(v(s,!0)),o.append(a),n=a.find("input"),i=a.find('[data-model="list"]'),r=null,n.on("input",function(t){var e;e=$(this).val(),clearTimeout(r),r=setTimeout(function(){g(e,i)},1e3)}),e.hide(),a},"none-of-all":function(){var t;return t=$(b("custom")),$(this).parent().after(t),e.hide(),t}},w={show:function(t,e){a.text(t).slideDown("fast"),setTimeout(function(){w.hide(),e&&e()},3e3)},hide:function(){a.slideUp("fast")},reset:function(){a.hide().empty()}},_=function(t){var e,n,o=(t.type,t.typeText),r=t.actionText,a=t.reason;if(l.text(o),D.text(r),w.reset(),n=a,e=y(n,k),i.html(e),m&&m(n),$(".js-911-delete-tips").remove(),("answer"===t.type||"question"===t.type)&&"删除"===r&&window.config){var s=window.config["delete_"+t.type][1];$("#reportForm").append('

      注意:删除'+o+"将 "+s+" 声望

      "),$("#reportForm").append('

      我们不建议删除带有答案的问题,因为这样做会剥夺未来读者的获取知识的权利。
      经常删除已回答的问题可能会导致你的账户被降权。

      ')}},m=function(t){var n;n=[],r.on("click.911","input[type=radio]",function(t){var o;n.length>0&&(n[0]&&!$.contains(n[0][0],this)?(n[0].off().remove(),n.splice(0,2)):n[0]||n.splice(0,1)),o=$(this).data("action"),o?(n.unshift($(this)),"q-duplicate"===o?n.unshift(f[o]&&f[o].call(this,$(this).val())):n.unshift(f[o]&&f[o].call(this,$(this).data("reason")))):n.unshift(!1),n.some(function(t){return t})&&"none-of-all"!==o&&e.show()}),r.on("click.911",'[data-role="back"]',function(t){for(var e;!(e=n.shift()););e.off().remove(),n.shift().prop("checked",!1),0===n.length&&$(this).hide()}),r.on("click.911",'[data-role="submit"]',function(t){var e,n,i,a,s,l;if(e=o.serializeArray(),l=[],o.find("input[type=radio],textarea").each(function(t,e){var n;n=$(e).attr("name"),$.inArray(n,l)===-1&&l.push(n)}),e.length!==l.length)return void w.show("请完善理由");for(i=0,a=e.length;i应用内打开\n
      ';$("body").prepend(c),$("body").on("touchend",".fa-close",function(t){t.preventDefault(),$(".app-open-in-bar").remove()})}if(t("Android")&&!l){var u='
      \n \n
      \n
      SegmentFault
      \n

      一起探索更多未知

      \n 应用内打开\n
      ';$("body").prepend(u);var p=navigator.userAgent.toLowerCase();/micromessenger/.test(p)?$(".download-btn").attr("href",a+"#android"):$("body").on("click",".download-btn",function(t){setTimeout(function(){location.href="/app"},1e3)}),$("body").on("touchend",".fa-close",function(t){t.preventDefault(),$(".app-open-in-bar").remove()})}}),requirejs(["main","pingpp","isMobile","commentNews","bookmark","statusToggle","sfModal","sf_share","highLight","sf_pay","template","specialUrl","contentIndex","sf_tagpopup","userFollow","911","jquery_cookie","jquery_lazyload","jquery_qrcode","underscore","openInApp","jquery_qrcode"],function(t,e,n,o,i,r,a,s,l,c,u,p,d){var h,f,m,g,v,y,b,_,w,k,x,D,C,S,E,A;l($(".article.fmt")),$(".tagPopup .tag").tagpopup(),$(".fmt").find("img").lazyload({data_attribute:"src"}),p(),function(){"undefined"!=typeof ParadigmSDK&&ParadigmSDK.getRecommItems("594",function(t){for(var e="",o=n("any"),i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'"),e+='
    • "+r.title+''+r.publisher_id+"";for(var a=r.tag.split(","),s=0;s'+l+""}e+="
    • "}e.length>0&&$("#paradigm-article-related").html('
      ")})}();var T=$("#articleTitle").data("id");$(document).scroll(function(){var t=$(".loginBanner").length>0?$(".loginBanner").eq(0).offset().top:$("#footer").offset().top,e=$(".ad-should-be-fixed").height()+$(".side-outline").height(),n=Math.min(e,window.innerHeight);document.documentElement.scrollTop+n+30>=t?$(".side-outline,.ad-should-be-fixed").css("display","none"):$(".side-outline,.ad-should-be-fixed").css("display","block")}),"nd"===$(".article.fmt").data("license")&&$(".article.fmt").mouseup(function(t){var e,n,o,i;if($(".license-tooltip").remove(),e=t.pageX-75,n=t.pageY-45,o=window.getSelection().toString(),o.length)return i=$(""),$("body").append(i)}),D=!0,C=function(){if("false"===$.cookie("showRegister")&&"false"!==$.cookie("showRegister2")&&$(".widget-register").hasClass("hidden"))return $(".widget-register .container").html($("#regNext").html()),$(".widget-register").removeClass("hidden"),$(".widget-register .tomorrow").on("click",function(){return $.cookie("showRegister2","false",{expires:1,path:"/"}),$(".widget-register").addClass("widget-register-slideDown"),setTimeout(function(){$(".widget-register").remove()},1e3)})},$(document).scroll(function(){C(),$.cookie("showRegister")||($(".widget-register").removeClass("hidden"),$(".widget-register .tomorrow").on("click",function(){$.cookie("showRegister2")||$.cookie("showRegister2","true",{expires:1,path:"/"}),$.cookie("showRegister","false",{expires:1,path:"/"}),$(".widget-register").addClass("widget-register-slideDown")}))}),k=$("#articleTitle").data("id"),$("#sideBookmark, #mainBookmark").each(function(){$(this).click(function(){var t=$(this);t.hasClass("active")?i.editBookmark(t,function(t,e){0===e&&($("#sideBookmark, #mainBookmark, #side-widget-bookmarks-btn").each(function(){$(this).removeClass("active")}),$("#sideBookmarkText").text("收藏"),$("#mainBookmarkText").text("收藏")),$("#sideBookmarkNum").text(t.data),$("#mainBookmarkNum").text(t.data)}):i.addBookmark(t,function(t){$("#sideBookmark, #mainBookmark, #side-widget-bookmarks-btn").each(function(){$(this).addClass("active")}),$("#sideBookmarkText").text("已收藏"),$("#mainBookmarkText").text("已收藏"),$("#sideBookmarkNum").text(t.data),$("#mainBookmarkNum").text(t.data)})})}),f=$("#mainLike"),m=$("#sideLike");var P=$("#side-widget-votes-btn");E=$("#sideLikeNum"),A=$("#mainLikeNum");$("#mainLikeText"),$("#sideLikeText");r(f),r(m),$("#mainLike, #sideLike").each(function(){$(this).click(function(){var t;t=$(this),t.hasClass("active")?t.trigger("unactive",function(){$.post("/api/article/"+t.data("id")+"/like/cancel",function(e){t.html(t.data("old")),0===e.status&&(f.removeClass("active"),m.removeClass("active"),P.removeClass("stream__item-zan--active active"),$("#sideLikeNum").text(e.data),$("#mainLikeNum").text(e.data),$("#side-widget-votes-num").text(e.data),$("#sideLikeText").text("赞"),$("#mainLikeText").text("赞"))})}):t.trigger("active",function(){$.post("/api/article/"+t.data("id")+"/like",function(e){t.html(t.data("old"));0===e.status&&(f.addClass("active"),m.addClass("active"),P.addClass("stream__item-zan--active active"),$("#sideLikeNum").text(e.data),$("#mainLikeNum").text(e.data),$("#side-widget-votes-num").text(e.data),$("#sideLikeText").text("已赞"),$("#mainLikeText").text("已赞"))})})})}),$(".js__ops-action").click(function(){var t,e,n,o;return t=$(this),o=t.data(),e=t.text(),n="/api/article/"+o.id+"/"+o.action,a({title:"确认"+e,content:"您确认要"+e+"文章「"+o.title+"」吗?",doneFn:function(){return $.post(n,function(t){if(0===t.status)return window.location.reload()})}})}),$("#articleShow").click(function(){var t;t=$(this),a({title:"确认隐藏",content:"您确认要显示文章「"+t.data("title")+"」吗?",closeText:"取消",doneText:"显示",doneFn:function(){$.post("/api/article/"+t.data("id")+"/hide/cancel",function(t){0===t.status&&window.location.reload()})}})}),$("#articleRecommend, #cancelDel").click(function(){var t;t=$(this),$.sfAjax(t,function(){location.reload()})}),$("#articlePublish").click(function(){var t;t=$(this),$.post("/api/article/"+$(this).data("id")+"/publish",function(t){t.status||location.reload()})}),w=$(".widget-share__full").data("text"),_=[],$(".article.fmt img").each(function(){var t;return t=$(this).data("src"),!t||0!==t.indexOf("/image?src")&&0!==t.indexOf("/img/")||(t=location.origin+t),_.push(t)}),$(".tagPopup .tag").each(function(){var t;t=$(this).data("img"),t&&_.push(t)}),0===_.length&&_.push("http://tp1.sinaimg.cn/2036070420/180/40003289296/0"),y=$('meta[name="description"]').attr("content"),new s(".widget-share__full",{image:_.join("||"),text:"【"+w+"】分享自 @SegmentFault,文章传送门:",title:"【"+w+"】分享自 @SegmentFault,文章传送门:",networks:{renren:{title:w+" - SegmentFault",description:y+"... ",comment:""},douban:{title:w+" - SegmentFault",description:y+"... ",comment:""},twitter:{text:"【"+w+"】分享自@segment_fault,文章传送门:",title:"【"+w+"】分享自@segment_fault,文章传送门:"}}},!0),$(".article").find("h1, h2, h3").length&&($(".post-nav").show(),d(".article",".articleIndex"),0===$(".articleIndex li").length&&$(".widget-outline").remove()),S=void 0,h=$(".dont-likeweibo"),h.click(function(t){$.cookie("dontlikeShare",!0,{path:"/"})}),"#shareToWeibo"===location.hash&&(S="http://service.weibo.com/share/share.php?url="+encodeURIComponent(location.origin+location.pathname)+"&title="+encodeURIComponent("我在 @SegmentFault 发布了文章【"+$("#articleTitle a").text().trim()+"】,传送门:")+"&appkey=1742025894", $("#shareToWeiboModal").find("#shareLink").attr("href",S),$("#shareToWeiboModal").modal("show")),$("#reloadCaptcha").click(function(){$(this).find("img").attr("src","/user/captcha?w=178&h=35")}),b=$("#mail").val(),$("#user").submit(function(t){var e,n,o,i,r,a;t.preventDefault(),e=$(this),n=e.find("input").not("input[disabled]"),i=n.index($("input:focus")),r=n.slice(i+1),o=!1,r.length&&r.each(function(){var t,e;if(e=$(this).attr("type"),t=["text","email","password","url"],!$(this).val()&&t.indexOf(e)!==-1)return $(this).focus(),o=!0,!1}),o||(e.find("button[type=submit]").attr("disabled","disabled"),b=$("input[name=mail]").val(),a={mail:b,name:$("input[name=name]").val(),password:$("input[name=password]").val(),captcha:$("#captcha").val(),ref:$("input[name=ref]").val()},$.post("/api/user/register",a,function(t){e.find("button[type=submit]").removeAttr("disabled"),0===t.status?location.reload():($("#captcha").val(""),$("#reloadCaptcha img").attr("src","/user/captcha?w=178&h=35"),t.data[1].captcha&&($("#captcha").removeAttr("disabled"),$("#captcha").parents(".captcha-part").show()))}))}),$(".blog-follow").click(function(t){var e;t.preventDefault(),e=$(this),e.attr("disabled","disabled"),$.sfAjax(e,function(t){e.hasClass("active")?e.removeClass("active").find(".blog-text").text("关注"):e.addClass("active").find(".blog-text").text("已关注"),e.find(".blog-followers").text(t.data),e.removeAttr("disabled")})}),$(".follow-user").click(function(t){var e;t.preventDefault(),e=$(this),e.attr("disabled","disabled"),$.sfAjax(e,function(){e.hasClass("active")?e.removeClass("active").text("关注作者"):e.addClass("active").text("取消关注"),e.removeAttr("disabled")})}),$(".follow-article").click(function(t){var e;t.preventDefault(),e=$(this),e.attr("disabled","disabled"),$.sfAjax(e,function(){e.hasClass("active")?e.removeClass("active").text("关注专栏"):e.addClass("active").text("取消关注"),e.removeAttr("disabled")})});$(".article__reward-btn").on("click",function(){var t=$(".article__reward-btn").data("id"),e={type:1,prices:[2,5,10,20,50,100],price:2,title:"赞赏作者",api:"/api/article/"+t+"/reward",formData:{}};c(e)}),location.search.split("?").length>1&&location.search.split("?")[1].indexOf("pay")!=-1&&$(".article__reward-btn").length&&$(".article__reward-btn").trigger("click"),$(".article__reward-list-btn").popover({html:!0}).on("shown.bs.popover",function(){$(".article__reward-item").tooltip()});var B=new o({mod:"article"});if($("#SFEventObject").length>0){x=JSON.parse($("#SFEventObject").attr("value")),v=x.current[0],g=x.current[1];var I=x.root[0],L=x.root[1],F=function(){g.forEach(function(t,e){$("[data-id="+t+"]").addClass("highlight"),setTimeout(function(){},3e3),e||setTimeout(function(){$("html, body").scrollTop($("[data-id="+t+"]").offset().top)},100)})};"article"===I?"comment"===v&&F():B.unfoldCommentArea(L,F)}var j='\n
      \n
      \n \n
      \n \n
      \n
      \n
      \n \n
      \n \n
      \n
      \n
      \n ',O=$(".wrap").data("blogid"),M=function(){a({title:"申请开通赞赏",$content:j,doneText:"提交",doneFn:function(){var t=$(".form__reward-apply").serializeArray(),e={};t.map(function(t){e[t.name]=t.value}),$.post("/api/apply/reward",e,function(t){t.status||(location.href="/user/settings?tab=blog&id="+O)})}})},R=function(){a({modalSize:"modal-lg",title:"登录",doneText:"登录",hideClose:!0,hideDone:!0,hideFooter:!0,content:$("#loginModal").text(),show:function(){return window.ga&&ga("send","event","login modal","show","login modal"),$("[name=mail]").first().focus(),$("#loginShowMore").click(function(t){t.preventDefault(),$(this).hide(),$(this).siblings().removeClass("hidden")}),$(".sfmodal .widget-login a").click(function(t){t.preventDefault(),window.open($(this).attr("href"),"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500")}),$("#loginReloadCaptcha").click(function(){$(this).find("img").attr("src","/user/captcha?w=240&h=50")})}}),$(".register-mail").typeHelperOld({emailMode:!0,onlyResult:!1})};t={reward:M,login:R,userId:$("#SFUserId").attr("value")},$(".post__reward--application-btn").on("click",function(e){var n=Boolean($(this).data("phone"));n?t.reward():a({modalSize:"modal-md",title:"绑定手机号",doneText:"下一步",content:$("#bindPhoneModal").text(),doneFn:function(){var e=$(".form__bindphone-apply").serializeArray(),n={};e.map(function(t){n[t.name]=t.value}),$.post("/api/user/phone/bind/check",n,function(e){e.status||t.reward()})}})}),$(".widget-share__full > div:first").remove(),$("table,svg").each(function(t,e){var n=$(this),o=n.width()>n.closest(".row").children().first().width();0==n.closest(".table-wrap").length&&o&&n.wrap('
      ')}),$(".fa-weixin").popover({html:!0,content:'\n
      \n ',trigger:"hover"}),$(".fa-weixin").on("shown.bs.popover",function(){var t=$(".widget-share__full").data("url");t+=t.includes("share_user")?"&utm_source=Wechat&utm_medium=shareLink":"?utm_source=Wechat&utm_medium=shareLink",console.log(t),$("#side-widget-weixin-share").qrcode({text:t,width:120,height:120})}),$("#side-widget-votes-btn").on("click",function(){return $("#mainLike").trigger("click"),!1}),$("#side-widget-bookmarks-btn").on("click",function(){return $("#mainBookmark").trigger("click"),!1}),$(".fa-weibo").on("click",function(){return $('[data-network="weibo"]').trigger("click"),!1}),$(".fa-twitter").on("click",function(){return $('[data-network="twitter"]').trigger("click"),!1}),$(".fa-facebook").on("click",function(){return $('[data-network="facebook"]').trigger("click"),!1}),$(document).scroll(function(){$(document).scrollTop()>$(".article__content").height()+$(".article__content").offset().top?$(".side-widget").hide():$(".side-widget").show(),$(window).scrollTop()>$(window).height()?$(".fa-arrow-up").removeClass("hidden"):$(".fa-arrow-up").addClass("hidden")}),$(".fa-arrow-up").on("click",function(){$(window).scrollTop(0)});var q,N,U,z,H,W,Y;U=$("#seo"),q=U.find('[data-model="returnMsg"]'),z=$("#seoForm"),H=U.find("[name=title]"),W=U.find("[name=desc]"),Y=U.find("[name=keywords]"),N={show:function(t,e){q.text(t).slideDown("fast"),setTimeout(function(){N.hide(),e&&e()},3e3)},hide:function(){q.slideUp("fast")},reset:function(){q.hide().empty()}},N.hide(),U.on("shown.bs.modal",function(t){$.get("/api/article/"+k+"/seo",function(t){if(0===t.status){var e=t.data;H.val(e.title),W.val(e.desc),Y.val(e.keywords)}else if("login"===t.data[0])U.modal("hide");else{var n="";for(var o in t.data[1])n+=t.data[1][o];N.show(n)}},"json")}),U.on("click.seo",'[data-role="submit"]',function(t){var e,n,o,i,r,a;if(e=z.serializeArray(),a=[],z.find("textarea").each(function(t,e){var n;n=$(e).attr("name"),$.inArray(n,a)===-1&&a.push(n)}),e.length!==a.length)return void N.show("请完善填写数据");for(o=0,i=e.length;o